Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Ajax, changing text in a button, and button click problem

Reply
Thread Tools

Ajax, changing text in a button, and button click problem

 
 
Tim
Guest
Posts: n/a
 
      07-23-2008
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";
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fire both event button click and textchanged when button is click and text is changed Amy ASP .Net 0 06-01-2006 02:33 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Building Controls 1 05-28-2004 06:23 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Datagrid Control 0 05-25-2004 01:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57