hi I have created one method createdropdown()in that i had create one dynamic dropdownlist and in selectindexchange of that dropdownlist i had created another dynamic dropdownlist and again selectedindexchange of the second dropdown . but when i run this code it will call first selectedindexchange when i select the dropdownvalue but it want call second selectedindexchange. i had done autopostBack=true for both the dropdownlist. Please Help It is some urgent Task that i have to complet. in the below ddl_SelectedIndexChanged() is call but ddl2____SelectedIndexChanged is not fired.....? // Add DropDownList Control to Placeholder private void CreateDropDownBoxes() { //int counter= Convert[ViewState ("counter"),Int32]; for (int counter = 0; counter <= NumberOfControls; counter++) { DropDownList ddl = new DropDownList(); ddl.ID = "DropDownList_ID" + (counter + 1).ToString(); ddl.AutoPostBack = true; ddl.AppendDataBoundItems = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); DataTable dt = new DataTable(); dt = getdata_workspace(); ddl.DataSource = dt; ddl.DataTextField = "displayedname"; ddl.DataValueField = "id"; ddl.DataBind(); phDropDownLists.Controls.Add(ddl); phDropDownLists.Controls.Add(new LiteralControl(" ")); } } public void ddl_SelectedIndexChanged(object sender, EventArgs e) { int n = this.NumberOfControls; for (int i = 0; i < n; i++) { SqlConnection conn = new SqlConnection(connStr); string boxName = "DropDownList_ID" + (i + 1).ToString(); DropDownList ddl2_ = phDropDownLists.FindControl(boxName) as DropDownList; DropDownList ddl2___ = new DropDownList(); ddl2___.ID = "DropDownList__" + (i + 1).ToString(); ddl2___.AutoPostBack = true; ddl2___.AppendDataBoundItems = true; ddl2___.EnableViewState = true; SqlCommand cmd = new SqlCommand("select * from unit where workspaceid='" + ddl2_.SelectedValue + "'", conn); conn.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { ddl2___.Items.Add(dr.GetString(2)); } // ddl2___.EnableViewState = true; ddl2___.SelectedIndexChanged += new EventHandler(ddl2____SelectedIndexChanged); ddl2___.DataTextField = "displayedname"; ddl2___.DataValueField = "id"; phTextBoxes.Controls.Add(ddl2___); phTextBoxes.Controls.Add(new LiteralControl(" ")); } // throw new Exception("The method or operation is not implemented."); } void ddl2____SelectedIndexChanged(object sender, EventArgs e) { int n = this.NumberOfControls; for (int i = 0; i < n; i++) {
hhems
Posts
-
dynamic control (c# ASP.net) -
dynamic controlhi I have created one method createdropdown()in that i had create one dynamic dropdownlist and in selectindexchange of that dropdownlist i had created another dynamic dropdownlist and again selectedindexchange of the second dropdown . but when i run this code it will call first selectedindexchange when i select the dropdownvalue but it want call second selectedindexchange. i had done autopostBack=true for both the dropdownlist. Please Help It is some urgent Task that i have to complet. in the below ddl_SelectedIndexChanged() is call but ddl2____SelectedIndexChanged is not fired.....?
// Add DropDownList Control to Placeholder private void CreateDropDownBoxes() { //int counter= Convert[ViewState ("counter"),Int32]; for (int counter = 0; counter <= NumberOfControls; counter++) { DropDownList ddl = new DropDownList(); ddl.ID = "DropDownList_ID" + (counter + 1).ToString(); ddl.AutoPostBack = true; ddl.AppendDataBoundItems = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); DataTable dt = new DataTable(); dt = getdata_workspace(); ddl.DataSource = dt; ddl.DataTextField = "displayedname"; ddl.DataValueField = "id"; ddl.DataBind(); phDropDownLists.Controls.Add(ddl); phDropDownLists.Controls.Add(new LiteralControl(" ")); } } public void ddl_SelectedIndexChanged(object sender, EventArgs e) { int n = this.NumberOfControls; for (int i = 0; i < n; i++) { SqlConnection conn = new SqlConnection(connStr); string boxName = "DropDownList_ID" + (i + 1).ToString(); DropDownList ddl2_ = phDropDownLists.FindControl(boxName) as DropDownList; DropDownList ddl2___ = new DropDownList(); ddl2___.ID = "DropDownList__" + (i + 1).ToString(); ddl2___.AutoPostBack = true; ddl2___.AppendDataBoundItems = true; ddl2___.EnableViewState = true; SqlCommand cmd = new SqlCommand("select * from unit where workspaceid='" + ddl2_.SelectedValue + "'", conn); conn.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { ddl2___.Items.Add(
-
vb.net display records -
How can I find time that it is takingjust use timer
-
asp.net save filehelloo friends i am using Dim excel As New Excel.ApplicationClass() and with this i am retriving data from sql database and print in excel .but when i click on button i wan to store that excel file direct at particular location which i mention .how is it possible???????? :rose:Thanks:rose:
-
asp.net dropdownlisthi friends i am retriving data from xml .i got all the xml value in dropdown list.i have done this
asp:DropDownList id="dropdl"
AutoPostBack="true" runat="server"
OnSelectedIndexChanged
="rnd" but when i select any value from dropdownlist it gives only first value even if i am selected other value why??????????????????????? -
asp.net dropdownlisthiiii friends in asp.net i am retriving data from xml file. i got all the data in dropedownlist . now i want to put link on that value. suppose i have three value like x,y,z in dropeDown list. now when i click on x or y or z i wan new page. how it is possible help :rose:thanks :rose: :rose::rose::rose::rose::rose:
-
asp.net combbox & xmlhello friends i want combobox and in that combobox i want value that r in xml file. ALL THE XML FILE VALUE. AND AFTER GETTING THE VALUE I WANT TO LINK TO THE OTHER PAGE ON THAT ALLL VALUE WHICH ARE IN COMBOBOX. SUPPOSE:THIS XML TAG <NAME> HEMSS1 </NAME > <NAME2> HEMSS2 </NAME2> I WANT HEMSS1,HEMSS2 IN THE COMBOBOX,AND BY CLICKING HEMSS1 OR HEMSS2 I WANT TO OPEN ANOTHER PAGE OR DISPLAY A REPORT. SO HOW IT'S POSSIBLE. PLZ heLP ME!!!!!!!!!!! :rose:THANKS IN ADVANCE:rose:
-
asp.net webservici am a beginer of asp.net. so tell me what is the use of webServic in asp.net. which are the related file for that.means where i have to code bcz thr r dif file .cs,.aspx,.asmx(i dont know abt this).where to write which code. is their auto generated file then which are that. if possible then give me one full example. so i can do it my self and lern more. Thanks a lot for good response.
-
asp.net+http soap+sql serverhi friends i am prj trainee. i want to transfer data from one sqlserver to another server in text format with help of soap protocol(means one machine to another machine)in Asp.net. how can i do?????? plz guide me . plz help me. give me basic knowledge abt this :rose:Thanks in advance:rose: :rose::rose::rose::rose::rose::rose::rose::rose::rose::rose: