JQuery BlockUI with UpdatePanel Viewstate Issue
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-02-16T00:01:26Z
Indexed on
2010/03/18
6:01 UTC
Read the original article
Hit count: 916
I am using BlockUI to show a modal. Within the blocked modal I have an update panel. Within the update panel I have a textbox and a button that submits the content back to the server. Everything works fine up to this point (the blockUI is called, the modal appears, and the button performs the postback). However, when the button's click event is fired the value for the textbox is consistently empty even if text was entered. When the update panel updates the textbox shows up blank. It appears that this may be some sort of viewstate issue and I haven't turned off viewstate.
<a href="javascript:$.blockUI({ message: $('#divTest') });">SHOW MODAL</a>
<div id="divTest" style="display: none;">
<asp:UpdatePanel ID="upTest" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtTestVS" runat="server" /><br />
<asp:Button ID="cmdTest" Text="TEST" OnClick="cmdTest_Click" UseSubmitBehavior="false" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
SERVER-SIDE:
protected void cmdTest_Click(object sender, EventArgs e)
{ string x = txtTestVS.Text; }
String "x" always equal "".
© Stack Overflow or respective owner