T
Tim
Hi all,
I'm using AJAX.NET and I've coded a page that changes the text of a
button when a checkbox is clicked. The text changes from "Save" to
"Keep Processing".
The text change seems to work. However, when I then go to click on
the button, I click once, and nothing happens. I click again, and get
an error:
"System.Web.HttpException: The state information is invalid for this
page and might be corrupted. ---> System.Web.UI.ViewStateException:
Invalid viewstate."
A couple things that may be the problem:
1. I am using a content page which has a master page.
2. My checkbox and my button are inside an asp:multiview object.
I'm attaching my code for your review.
Relevant page code:
<asp:MultiView ID="Views" runat="server" ActiveViewIndex="0">
<asp:View ID="Step1" runat="server">
<asp:CheckBox ID="chCheck1" runat="server" Text="Automatically
Allocate Payment" AutoPostBack="true" Checked="true" />
<asp:updatepanel id="upSaveOrContinue" runat="server">
<triggers>
<asp:asyncpostbacktrigger controlid="chCheck1" />
</triggers>
<contenttemplate>
<asp:Button ID="bnNext" runat="server" Text="Post Payment" />
</contenttemplate>
</asp:updatepanel>
</asp:View>
</asp:MultiView>
And the relevant cs code:
void ckCheck1_CheckedChanged(object sender, EventArgs e)
{
if (ckAutoAllocate.Checked == true)
bnNext.Text = "Post Payment";
else
bnNext.Text = "Set Allocation";
}
I'm using AJAX.NET and I've coded a page that changes the text of a
button when a checkbox is clicked. The text changes from "Save" to
"Keep Processing".
The text change seems to work. However, when I then go to click on
the button, I click once, and nothing happens. I click again, and get
an error:
"System.Web.HttpException: The state information is invalid for this
page and might be corrupted. ---> System.Web.UI.ViewStateException:
Invalid viewstate."
A couple things that may be the problem:
1. I am using a content page which has a master page.
2. My checkbox and my button are inside an asp:multiview object.
I'm attaching my code for your review.
Relevant page code:
<asp:MultiView ID="Views" runat="server" ActiveViewIndex="0">
<asp:View ID="Step1" runat="server">
<asp:CheckBox ID="chCheck1" runat="server" Text="Automatically
Allocate Payment" AutoPostBack="true" Checked="true" />
<asp:updatepanel id="upSaveOrContinue" runat="server">
<triggers>
<asp:asyncpostbacktrigger controlid="chCheck1" />
</triggers>
<contenttemplate>
<asp:Button ID="bnNext" runat="server" Text="Post Payment" />
</contenttemplate>
</asp:updatepanel>
</asp:View>
</asp:MultiView>
And the relevant cs code:
void ckCheck1_CheckedChanged(object sender, EventArgs e)
{
if (ckAutoAllocate.Checked == true)
bnNext.Text = "Post Payment";
else
bnNext.Text = "Set Allocation";
}