|
Hi All,
I get number of records when I fire a query in DataTable.There are 3 Columns namely columndatatype,columnname and displaycolumnname.Now I want the displaycolumnname to be display in listbox and combo and other 2 with displaycolumnname in Gridview where other 2 sould be visible false.
Please tell me how do I go about this.I need help in code.
Thanks in advance.
|
|
|
|
|
|
I have 2 tables first has ID,TableName,ViewName and other has ID,FirstID,ColumnName,DisplayColumnName,ColumnDataType.
What I want is to fill listbox and combo with DisplayColumnName and in GridView I want DisplayColumnName as Visible True and ColumnName and ColumnDataType as Visible False.
But I am using Viewstate datatable to bind GridView runtime.So I need to use Arraylist index so that I can use that index to bind the visible false columns with the respective DisplayColumnName.
Now I want a single Arraylist which will have ColumnName,ColumnDataType and ColumnDisplayName and when I put ColumnDisplayName in GridView I want ColumnName and ColumnDataType at the same index as of ColumnDisplayName.
Hope u understood what I want to do??
Please help me for the same.
|
|
|
|
|
pls help me in writing asp.net code for 'ticket avaliability' module of travel & tourism project.I've just started learning .net so kindly help me out.
|
|
|
|
|
It solely depends upon your reqirement. Lets say you have availabilty for specific source-destination for all dates. so whenevr a user selects his/her source, destination, date of travel, no. of tickets decresae the avaialbilty in the databse according to the no. of tickets.
Basic idea! what have you done so far??
Gautham
|
|
|
|
|
Hi
I am working on asp.net 2003 , i am suffering dubugging from last one week
please any one idea about this plz reply me
It show dialog box when i go for debug.
actually i have loaded dot net 2003 and 2005 in single operating system but dotn't say remove dot net 2005.
---------------------------------------------------------------------------------------------------------------------------------------------
Error while tring run project : Unable to start debugging on the web server
Click Help for more information
OK HELP
------------------------------------------------------------------------------------------------------------------------------------------
thx in advance
|
|
|
|
|
Within the IIS management tool, select your virtual dir.
Right-click and select Properties
In the Properties dialog box, click on the Create button.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Go to your web.config file. follow the instructions.
<Configaration>
<system.web>
<compilation defaultlanguage="vb" <b>debug="true"> </b>
Now run your application(Press F5).
Hope it is helpfull.
Liyakhat AliKhan
Software Developer
Photon Info tech, Chennai.
|
|
|
|
|
Hello Everyone,
I have made a webform in asp.net 2005 with a calendar control, please see below for code. I have another webpage with hyperlink to popupcalendar page. The problem is the second page has a masterpage and when i click the hyperlink the popupcalendar is displayed but the date selected is not being transferred to the text box in the second page, It works fine if i remove the master page link from the second page, any ideas guys whats happening here.
HTML CODE - Popup Calendar:
<%@ Page Language="vb" AutoEventWireup="false" Inherits="KMAttendance.PopUp" CodeFile="PopUp.aspx.vb" %>
<title>PopUp
<asp:calendar id="calDate" onselectionchanged="Change_Date" runat="server" borderwidth="1px" backcolor="White"
="" width="220px" daynameformat="FirstLetter" forecolor="#003399" height="200px" font-size="8pt" font-names="Verdana" bordercolor="#3366CC" cellpadding="1">
<todaydaystyle forecolor="White" backcolor="#99CCCC">
<selectorstyle forecolor="#336666" backcolor="#99CCCC">
<nextprevstyle font-size="8pt" forecolor="#CCCCFF">
<dayheaderstyle height="1px" forecolor="#336666" backcolor="#99CCCC">
<selecteddaystyle font-bold="True" forecolor="#CCFF99" backcolor="#009999">
<titlestyle font-size="10pt" font-bold="True" height="25px" borderwidth="1px" forecolor="#CCCCFF"
="" borderstyle="Solid" bordercolor="#3366CC" backcolor="#003399">
<weekenddaystyle backcolor="#CCCCFF">
<othermonthdaystyle forecolor="#999999">
VB CODE-popup calendar:
Imports System.Web.UI.HtmlControls.HtmlGenericControl
Namespace KMAttendance
Partial Class PopUp
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'control.Value = Request("textbox")
control.Value = Request.QueryString("textbox")
End Sub
Protected Sub Change_Date(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim strScript As String = "window.opener.document.forms(0)." + Request.QueryString("textbox").ToString() + ".value = '"
'strScript += calDate.SelectedDate.ToString("dd/MM/yyyy")
strScript += calDate.SelectedDate.ToLongDateString
strScript += "';self.close()"
strScript += "</" + "script>"
RegisterClientScriptBlock("Calendar_ChangeDate", strScript)
'Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "anything", strScript, True)
End Sub
Private Sub InitializeComponent()
End Sub
End Class
End Namespace
HTML Code-Second Webpage
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="NoUpdate.aspx.vb" Inherits="KMAttendance.NoUpdate" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table border="0" align="Left" cellpadding="0" cellspacing="4" bordercolordark="silver" style="width: 456px; height: 16px">
<tr> <td align="center" style="height: 19px; width: 61px;"> </td> <td align="Left" style="height: 19px; width: 103px;"> <table style="width: 286px; height: 57px">
<tr> <td style="width: 25px; height: 21px;"> <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/error.png" Width="20px" Height="19px" /></td> <td style="height: 21px"> <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Access Denied" Width="167px"></asp:Label></td> <td style="height: 21px"> </td> </tr> <tr> <td style="width: 25px; height: 21px"> <A onclick="window.open('popup.aspx?textbox=txtStartDate','cal','width=250,height=225,left=270,top=180')" href="javascript:;"><IMG src="Images/calendar.png" border="0"></A>
</td> <td style="height: 21px"> <asp:textbox id="txtStartDate" runat="server" width="106px" Height="12px"></asp:textbox></td> <td style="height: 21px"> </td> </tr> <tr> <td style="width: 25px"> </td> <td> </td> <td> </td> </tr> </table>
</td> </tr> </table>
</asp:Content>
<div class="ForumSig">Thanks in Advance for your help. Best Regards</div>
|
|
|
|
|
Hi,
I believe Master Page is not a problem.
SharonRao wrote: "window.opener.document.forms(0)." </blockquote>
Here forms(0) may not represent your Master Page.
Soln:
Try Use, document.getElementById('') and Pass the ClientId of your server control (TextBox) to the Popup Calendar. Hopefully it works fine.
<div class="ForumSig">Regards,
<b>Jay</b> </div>
|
|
|
|
|
Hello,
Thanks for the reply. I have changed the code in popupcalendar.aspx.vb,but it still is not working, any ideas where i have gone wrong.
Protected Sub Change_Date(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim strScript As String = "document.getElementByID('txtstartdate')." + control.Value + ".value = '"
strScript += calDate.SelectedDate.ToLongDateString
strScript += "';self.close()"
strScript += "</" + "script>"
RegisterClientScriptBlock("Calendar_ChangeDate", strScript)
End Sub
<div class="ForumSig">Thanks in Advance for your help. Best Regards</div>
|
|
|
|
|
Hi all,
I have had what appears to be a very simple request from one of my clients - but am not sure how (or if) this can be done. Basically, they need to be able to let about 6-10 people access and edit an Excel 2003 spreadsheet from anywhere (ie: they could be inside or outside the corporate intranet) and my idea was to allow them to do it through an ASP.Net 2 web page. This means the s/sheet would always reside on the server but could only be edited by one person at a time (which is what the client wants - if it's open for edit all other users will be told the s/sheet is not available - or perhaps they can just view it but not save it.)
So how do I go about this using VS2005 and ASP.Net 2? Is it just a matter of having an <embed /> tag in the HTML or is there a better, easier or more advance way to do it? I've googled quite a bit for this and found lots of pages about importing or exporting Excel data but I want to edit & save the s/sheet in place and I can't find anything about that.
TIA for suggestions or feedback.
Mike
|
|
|
|
|
IMHO, you might want to check out a couple of things:
+ Use Webdav to manage/edit the files.
+ Show the file contents at the client side in the Excel-like display, here you can might want to look for some custom grid controls supporting Excel-like style, then the client can edit in the web page and finally submit the changes to the server.
+ You can allow the user to open the Excel file on their box with the Excel application, then you can use an Excel add-in to capture the Save action to send the edited file to the server.
|
|
|
|
|
Is there any form generator or template to create search forms? I just want to display data from my sql server 2005 tables using drop down menu or search field. I'll greatly appreciate any help.
|
|
|
|
|
Hi Guys/Gals,
I have a template field called "Details"(A button field) for each row in the Gridview control.
How do i know at which row/index the "Details" button is clicked? Because I cannot use SelectedIndex/ SelectedRow when "Details" button is directly clicked?
I would really appreciate it if anyone could help me in this matter?
Thanks,
Murthy here
|
|
|
|
|
Try to find e.row.rowindex on row editing if u want to edit that row.
|
|
|
|
|
Actually what it does is it redirects the page to the details of the particular row. so they are not actually editing that row. they are not even selecting but they are going to click the button directly.
thanks,
Murthy here
|
|
|
|
|
Did you try Itemcommand??
Gautham
|
|
|
|
|
no i do not know anything about itemcommand. can u please elaborate that please?
and how do i use e.row.rowindex command?
thanks a lot,
Murthy here
|
|
|
|
|
Hi,
I want to check if an item read from a database exists in the combobox before I add it to the combobox, so that the item is not repeated in the combox. For example I want to check for the reader["Area"] doesn't exist in "comboArea", if it doesn't exist, then add it to the combobox.
how can I translate that in C# language??
I'm not sure how it's written.
If anybody has anybody has any idea how to do this, plz send it.
|
|
|
|
|
You're adding items from the DB on postback, but not clearing it ? I think the comboBox.Items property lets you check if an item is there, you'd have to add them on at a time, but you must be doing that already.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
While populating the combobox,you can add both text and value like,
Fill the fieldname to be populated along with any unique field to distinguish the items(say same name for 2 persons but different EmpID exist in db) in a datatable(dt).
Then,
<br />
ComboBox1.DataSource = dt.DefaultView;<br />
ComboBox1.DataTextField = "fieldname";<br />
ComboBox1.DataValueField = "same or any unique field name to distinguish text field";
ComboBox1.DataBind();<br />
Then you can check the item's existence as,(in the method where you again populate)
<br />
ListItem item = ComboBox1.Items.FindByValue(dt2.Rows[0]["UniqueFieldName"].ToString());<br />
if(item==null)<br />
ComboBox1.Items.Add(new ListItem(dt2.Rows[0]["FieldName"].ToString(),dt2.Rows[0]["UniqueFieldName"].ToString()));<br />
else<br />
Hope this piece will help you.
Let me know if you have any issues over this
~VSree
|
|
|
|
|
Hi
I am confused regarding the statement All Web controls must be placed within a tag to function properly. I have added the following to a webform
<asp:literal id="Literal1" runat="server">
in the code behind I have the following Literal1.Text = "Hello World";
I do not have the web contorl within tag so how come it works.
I have also found that I can place other web controls on a web page and not have them between a tag and they work fine.
I would appreciate it if some one can explain this to me
Kind Regards
|
|
|
|
|
Hi,
It also confused me initially.
But what I found is that, only those web controls which needs a form tag to function are needed to be placed inside a form with Runat="server" attribute. I mean to say, when a form is submitted the value of the controls which will be posted back are of the above type. Thus textbox need to placed inside a form with runat="server" but for a label it is not mandatory.
I hope this answers your question.
Thanks,
Pradipta Basu
|
|
|
|
|
Only the controls that are rendered as form fields in the html code need to be inside the form to work.
The reason they do is that when the form is posted, only the data from the fields that are within the form is included in the request.
---
single minded; short sighted; long gone;
|
|
|
|