mardi 14 juillet 2015

Checkbox inside Update Panel causing full post back

I have registration form for users to fill up. In there, one field is there to which if user checks on the button a text box shoulld be enabled to enter the number. I have used following code :

<asp:UpdatePanel ID="upMSME" runat="server">
        <ContentTemplate>
            <tr>
                <td colspan="2">
                    <asp:Label ID="lblMSME" runat="server" Text="Whether covered under MSME (Tick whichever is applicable)"></asp:Label>

                    <asp:CheckBox AutoPostBack="true" Checked="true" ID="chbMSME" runat="server" OnCheckedChanged="chbMSME_CheckedChanged" ClientIDMode="AutoID"/>
                </td>
            </tr>
            <tr id="trMSMENo" runat="server">
                <td>
                    <asp:Label ID="lblMSMENo" runat="server" Text="MSME Number" CssClass="alignTop"></asp:Label>
                </td>
                <td class="ValueBox">
                    <asp:TextBox ID="txtMSMENo" runat="server" MaxLength="75"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvMSMENo" runat="server" ForeColor="Red" ErrorMessage="*" ControlToValidate="txtMSMENo" ValidationGroup="vgVendor"></asp:RequiredFieldValidator>

                </td>
            </tr>
        </ContentTemplate>
    </asp:UpdatePanel>

However I searched over internet and found that by setting the ClientIDMode="AutoID" the issue is resolved. But in my case after setting the property there is still full postback occurred.

What am I missing?




Aucun commentaire:

Enregistrer un commentaire