Sunday, March 11, 2012

UpdatePanel AutoPostBack does not always work

Hello, I was unable to repro the problem with the description you provided. I copy the page that I tried this on, everytime I type something on the textbox and hit enter, the ontextclick event is triggered on the server. Let me know if there is anything I am missing.

Thanks,
Federico

<script runat="server"> protected void TextBox1_TextChanged(object sender, EventArgs e) { Label1.Text = TextBox1.Text; }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>    <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:CheckBox ID="CheckBox1" runat="server" /> <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" OnTextChanged="TextBox1_TextChanged"></asp:TextBox> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> </div> </form></body></html>

No comments:

Post a Comment