Hi,
I am using Asp.Net 3.5. I am having two problems in dropdown inside the update panel. I have two drop down list. First dropdown i loaded the data from db. Its working fine. Once i changed the data using SelectedIndexChange event it's firing first time(i put AutoPostback="true") if i click multiple times for multiple data it's not fired. If changed the value i bind the data to another dropdown list. But it is not binding. My control is inside the update panel. What is the problem? i came across multiple site and try it.But no use? Its very urgent. I put the code here.
//////////// HTML Source Code/////////////////////////
///////Code behind///////////////////Code:<form id="MAppNHSTDAfrm" runat="server"> <telerik:RadScriptManager ID="RdScptMgrMAppNHSTDAfrm" EnablePartialRendering="true" AsyncPostBackTimeout="36000" runat="server"> </telerik:RadScriptManager> <telerik:RadStyleSheetManager ID="RdStyMgrMAppNHSTDAfrm" EnableStyleSheetCombine="true" runat="server"> </telerik:RadStyleSheetManager> <div class="contentcontainer"> <fieldset style="width: 98%; height: 93%"> <asp:UpdatePanel ID="uPnlProgramDetails" runat="server" UpdateMode="Conditional"> <ContentTemplate> <table border="0" cellpadding="3" cellspacing="2" style="width: 100%;"> <tr> <td id="Td7" runat="server"> Branch : <asp:DropDownList ID="uxBranch" runat="server" AutoPostBack = "true" onselectedindexchanged="uxBranch_SelectedIndexChanged"> </asp:DropDownList> </td> <td id="Td8" runat="server" class="datafield"> Trust : <asp:DropDownList ID="uxTrust" runat="server"> </asp:DropDownList> </td> </tr> </table> </ContentTemplate> <%--<Triggers> <%--<asp:AsyncPostBackTrigger ControlID="TypeOfApplicationDropDown" /> --%> <asp:AsyncPostBackTrigger ControlID="uxBranch" EventName="SelectedIndexChanged" /> </Triggers>--%> </asp:UpdatePanel> </fieldset> </div> </form>
Hope your's reply.Code:protected override void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { FillDropDown(); } } protected void FillDropDown() { FillForBranch(); } //Fill data for first drop down when page load protected void FillForBranch() { try { ResultBE result; DataTable lookUpTable = new DataTable(); lookUpReference = new LovValueBLL(); lookUpTable = lookUpReference.GetLovValue(27, "%", out result); uxBranch.DataTextField = "ValueDesc"; uxBranch.DataValueField = "ID"; uxBranch.DataSource = lookUpTable; uxBranch.DataBind(); AddSelect(uxBranch); //uxBranch.SelectedIndex = 0; } catch (Exception ex) { ex.ToString(); } } // select changed the value from the first dropdown and load in other drop down protected void uxBranch_SelectedIndexChanged(object sender, EventArgs e) { if (uxBranch.SelectedValue == "1738") { FillForBranchAdult(); } if (uxBranch.SelectedValue == "1739") { FillForBranchChild(); } if (uxBranch.SelectedValue == "1740") { FillForBranchMentalHealth(); } } protected void FillForBranchAdult() { try { ResultBE result; DataTable lookUpTable = new DataTable(); lookUpReference = new LovValueBLL(); lookUpTable = lookUpReference.GetLovValue(24, "%", out result); uxTrust.DataTextField = "ValueDesc"; uxTrust.DataValueField = "ID"; uxTrust.DataSource = lookUpTable; uxTrust.DataBind(); //uPnlProgramDetails.Update(); AddSelect(uxTrust); } catch (Exception ex) { ex.ToString(); } }
Thanks





Reply With Quote