I am trying last 3 days for one solution. But i could not fix it still. Problem is this one.
I am using telerik rad script manager in my asp.net web page. I have two update panel. one update panel is for whole page and
another update panel for one particular control. I put two drop down list in the second update panel. I gave AutoPostback = "True".
In update panel i gave UpdateMode = "Conditional". What my requirement is when i click selectedindexchanged in the first drop down the data will bind in the second drop down. I am using the Trigger event in the update panel for this event. My problem is the i select the value in the drop down, the selectedIndexChanged is fired and data bind in the second dropdown. This is happening in the first time only. When i click again in another value (second,third), nothing happened in the second drop down list that is the selectedIndexchanged is not fired. I gave ChildrenAsTriggers = "false" in the update panel, guided from one forum. But it doesnt work. This is my aspx designer page,.
<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>
<asp:UpdatePanel ID="unGeneralInformation" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="contentcontainer">
<fieldset style="width:98%;height:93%">
<div style="overflow: auto; height: 100%; width: 99%" id="Div1" runat="server">
<div style="height: 100%; width: 98%" id="ManifestDiv" runat="server">
<table border="0" cellpadding="3" cellspacing="2" width="100%">
<tr>
<td colspan="7">
<fieldset>
<legend>General Information</legend>
<table border="0" cellpadding="3" cellspacing="2" width="100%">
<tr>
<td class="datafield width0" width="4%">
</td>
<td class="datatext width1" width="20%">
MISIS ID.
</td>
<td class="datafield" width="26%">
<asp:TextBox ID="uxMISISNo2" runat="server" Enabled="false" />
</td>
<td id="Td3" runat="server" width="26%">
</td>
<td id="Td4" class="datafield" width="24%">
</td>
</tr>
<tr>
<td class="datafield width0">
</td>
<td class="datatext width1">
Birth Date
<br />
(DD-MMM-YYYY)
</td>
<td class="datafield">
<telerik:RadDatePicker ID="uxDateofBirth2" runat="server" DateInput-DateFormat="dd-MMM-yyyy"
Enabled="false" Skin="Default2006">
<DateInput ID="DateInput6" runat="server" LabelCssClass="radLabelCss_Default2006"
Skin="Default2006">
</DateInput>
<Calendar ID="Calendar5" runat="server" Skin="Default2006" UseColumnHeadersAsSelectors="False"
UseRowHeadersAsSelectors="False" ViewSelectorText="x">
</Calendar>
<DatePopupButton CssClass="radPopupImage_Default2006" />
</telerik:RadDatePicker>
</td>
<td id="Td5" runat="server" style="width: 100%;">
Cohort :
<asp:DropDownList ID="uxCohort" runat="server">
<asp:ListItem Value="1">--Select--</asp:ListItem>
<asp:ListItem Value="2">Green</asp:ListItem>
<asp:ListItem Value="3">Yellow</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="datafield width0">
</td>
<td class="datatext width1">
Trust and Allocation Code
</td>
<asp:UpdatePanel ID="unTACDetails" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<td id="Td7" runat="server">
Branch :
<asp:DropDownList ID="TrustAllocationBranch" runat="server"
AutoPostBack="true" OnSelectedIndexChanged="TrustAllocationBranch_SelectedIndexChanged">
</asp:DropDownList>
</td>
<td id="Td8" runat="server">
Trust :
<asp:DropDownList ID="TrustAllocationTrust" runat="server" Width="85%">
</asp:DropDownList>
</td>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="TrustAllocationBranch" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</tr>
</table>
</div>
</div>
</fieldset>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
========================================================
This is i put it in the above aspx page inside:
--------------------------------------------------------
<asp:UpdatePanel ID="unTACDetails" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<td id="Td7" runat="server">
Branch :
<asp:DropDownList ID="TrustAllocationBranch" runat="server"
AutoPostBack="true" OnSelectedIndexChanged="TrustAllocationBranch_SelectedIndexChanged">
</asp:DropDownList>
</td>
<td id="Td8" runat="server">
Trust :
<asp:DropDownList ID="TrustAllocationTrust" runat="server" Width="85%">
</asp:DropDownList>
</td>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="TrustAllocationBranch" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
=====================================================================================
This is my server side code
======================
protected void TrustAllocationBranch_SelectedIndexChanged(object sender, EventArgs e)
{
TrustAllocationTrust.ClearSelection();
TrustAllocationTrust.Items.Clear();
if (TrustAllocationBranch.SelectedIndex == 1)
{
FillForBranchAdult();
}
if (TrustAllocationBranch.SelectedIndex == 2)
{
FillForBranchChild();
}
if (TrustAllocationBranch.SelectedIndex == 3)
{
FillForBranchMentalHealth();
}
}
What is the problem? I solved this problem without update panel. But without updatepanel, the page is refreshed and my tab is disappeared. So i choose this way. Give me a solution.
Thanks
Ashok