How to update a control outside of an updatepanel?

Posted by Matin Habibi on Stack Overflow See other posts from Stack Overflow or by Matin Habibi
Published on 2010-05-19T10:36:46Z Indexed on 2010/05/19 10:40 UTC
Read the original article Hit count: 275

Filed under:
|

Dear all,

I am going to show some text in a TextBox, which is located outside of an updatepanel, after checking a CheckBox but I cannot make it work. please help me out ?

Here is my code:

<asp:UpdatePanel runat="server" ID="uplMaster">
    <ContentTemplate>
        <asp:CheckBox ID="cbShowText" runat="server" Text="Show Some Text" AutoPostBack="true"
            OnCheckedChanged="cbShowText_CheckedChanged" />
    </ContentTemplate>
</asp:UpdatePanel>
<asp:TextBox ID="txtBox" Text="Empty" runat="server" />

Code Behind:

    protected void cbShowText_CheckedChanged(object sender, EventArgs e)
    {
        txtBox.Text = "Some Text";
    }

Thanks in advance :D

P.S. As you might have guessed, I have resembled my problem and that is why I don't want to put the TextBox in the UpdatePanel

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about updatepanel