Sunday, 25 August 2013

Textbox loses value on PostBack with updatePanel

Textbox loses value on PostBack with updatePanel

Hi i have an dropdownlist on my page on click of one dropdown another
dropdown is updated. bt as it updates the another dropdown a textbox on d
same page losses its value.
Here is the Code
<cc1:ContentBox ID="ContentTable2" runat="server" HeaderText="Form">
<asp:UpdatePanel runat="server" ID="upForm">
<ContentTemplate>
<table class="AppFormTable">
<tr runat = "server">
<td align="right"><b>Select Institute</b></td>
<td colspan = "2">
<asp:DropDownList ID="ddlInstitute" runat="server" Width =
"95%" AutoPostBack = "true" OnSelectedIndexChanged =
"ddlInstitute_SelectedIndexChanged"></asp:DropDownList>
<font color = "red"><sup>&nbsp;*</sup></font>
<asp:CompareValidator ID="cvInstitute" runat="server"
ControlToValidate="ddlInstitute" Display="None"
ErrorMessage="Please Select Institute."
Operator="NotEqual" ValueToCompare="-- Select Institute
--"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="right"><b>Select Course</b></td>
<td colspan = "2">
<asp:DropDownList ID="ddlCourse"
runat="server"></asp:DropDownList>
<font color = "red"><sup>*</sup></font>
<asp:CompareValidator ID="cvCourse" runat="server"
ControlToValidate="ddlCourse" Display='none'
ErrorMessage="Please Select Course." Operator="NotEqual"
ValueToCompare="-- Select Course
--"></asp:CompareValidator>
</td>
</tr>
<!-- Other fields -->
</table>
<table>
<tr>
<td>
<asp:textbox id="txtMarksOutOF" MaxLength="8" Width="50px" Runat="server">
</asp:textbox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnProceed" runat="server" Text="Save & Proceed >>>"
FontBold="True" CssClass="InputButton" OnClick="btnProceed_Click"
/></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</cc1:ContentBox>
Please Help me How should i resolve this.

No comments:

Post a Comment