Hello, Can someone help me in this problem.
In my content page, I used 2 user controls inside an Ajax Toolkit TabControl. One of the user controls is a data entry with a dropdownlist. The dropdownlist does not retain its selected value when I make a postback (click an update or save button). But when I run it without Tabcontrol, it's ok. Is there anything I should add to the code?
Here's the aspx script:
Thanks a lot....
In my content page, I used 2 user controls inside an Ajax Toolkit TabControl. One of the user controls is a data entry with a dropdownlist. The dropdownlist does not retain its selected value when I make a postback (click an update or save button). But when I run it without Tabcontrol, it's ok. Is there anything I should add to the code?
Here's the aspx script:
Code:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<act:TabContainer ID="TabPanel1" runat="server" ActiveTabIndex="0"
Height="600px" CssClass="ajax__tab_xp" OnActiveTabChanged="TabChanged" AutoPostBack="true">
<act:TabPanel ID="Panel1" runat="server"
HeaderText="Client List" ScrollBars="Auto">
<ContentTemplate>
<uc2:uc_ClientGrid ID="uc_ClientGrid1" runat="server" />
</ContentTemplate>
</act:TabPanel>
<act:TabPanel ID="TabPanel2" runat="server"
HeaderText="Details" >
<ContentTemplate>
<uc1:uc_client_info_insert ID="uc_client_info_insert1" runat="server" />
</ContentTemplate>
</act:TabPanel>
</act:TabContainer>
</asp:Content>
Here's the user control script:
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Panel ID="pnlClientInfo" runat="server"
GroupingText="CLIENTS INFO" Width="400px">
<table id="tblClientInfo" runat="server" class="clientInfo" >
<tr>
<td colspan="2">First Name:<br /><asp:TextBox ID="txtFirstname" runat="server" width="98%"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2">Last name:<br /><asp:TextBox ID="txtLastName" runat="server" width="98%"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2" >Address 1:<br /><asp:TextBox ID="txtAddress1"
runat="server" width="98%"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2" >Address 2 :<br /><asp:TextBox ID="txtAddress2" runat="server" width="98%"></asp:TextBox></td>
</tr>
<tr>
<td>City:<br /><asp:TextBox ID="txtCity" runat="server"></asp:TextBox></td>
<td>Province:<br />
<asp:DropDownList ID="cmbProvinces" runat="server" >
</asp:DropDownList>
</td>
</tr>
<tr>
<td>Postal Code:<br /><asp:TextBox ID="txtPostalCode" runat="server"></asp:TextBox></td>
<td>Home Phone:<br /><asp:TextBox ID="txtHomePhone" runat="server"></asp:TextBox></td>
</tr>
</table>
</asp:Panel>
</div>
<div id="msgBox" runat="server" style="font-family: Verdana; font-size: medium; color: #FF0000; font-style: italic">
</div>
<div >
<asp:Button ID="btnInsert" runat="server" Text="New" />
<asp:Button ID="btnUpdate" runat="server" Text="Edit" />
<asp:Button ID="btnDelete" runat="server" Text="Delete" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
Comment