Wednesday, July 28, 2010

How to use ajax (update panel) to enable disbale panel based on selection

<%@ Page Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script runat="server">
        public void SetAccountInfoStatus(object sender, EventArgs e)
        {
            this.pnlAccountInformation.Enabled = !this.ckboxAccountStatus.Checked;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>        
        <asp:UpdatePanel runat="server" ID="upnlAccountInformation">
            <ContentTemplate>
                <asp:CheckBox runat="server" ID="ckboxAccountStatus" Text="Account Closed" AutoPostBack="true" OnCheckedChanged="SetAccountInfoStatus" />
                <asp:Panel runat="server" ID="pnlAccountInformation">
                    <asp:TextBox runat="server" ID="txtAccountNo" Text="ACC12345676"></asp:TextBox>
                    <asp:TextBox runat="server" ID="txtMemeberNo" Text="MEM12345678"></asp:TextBox>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>

No comments:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...