Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Error on post back

Reply
Thread Tools

Error on post back

 
 
Wayne Sepega
Guest
Posts: n/a
 
      01-09-2006
I have two drop downs on my web form. The contents of DropDown2 depends on
what is currently selected in DropDown1. I use client side java script to
re-populate DropDown2 whenever DropDown1 changes.

In doing so, if I select a value in DropDown2 that wasn't there when the
page was built I receive the following error:

Exception Details: System.ArgumentException: Invalid postback or callback
argument. Event validation is enabled using <pages
enableEventValidation="true"/> in configuration or <%@ Page
EnableEventValidation="true" %> in a page. For security purposes, this
feature verifies that arguments to postback or callback events originate
from the server control that originally rendered them. If the data is valid
and expected, use the ClientScriptManager.RegisterForEventValidation method
in order to register the postback or callback data for validation.

I have tried doing the following:

protected override void Render(HtmlTextWriter writer)
{
DateTime curDate;
int dateCount = br.MaxPickUpDateDays + br.MaxExpirationDays;

if (subscription.ExpirationDate <= DateTime.Now.Date)
ClientScript.RegisterForEventValidation("DropDown2 ",
subscription.ExpirationDate.ToString(DateFormat));

for (int i = 0; i < dateCount; i++)
{
curDate = System.DateTime.Now.AddDays(i).Date;
ClientScript.RegisterForEventValidation("DropDown2 ",
curDate.ToString(DateFormat));
}
base.Render(writer);
}


However, when I do the above my DropDown2.SelectedValue always comes back
blank.

I've spent about an hr or so working on this and searching google, but all
the examples I find give me back a blank selected value. A point in the
right direction or some suggestions would be appreciated.

Thanks
Wayne Sepega


 
Reply With Quote
 
 
 
 
Henrique Mello
Guest
Posts: n/a
 
      01-09-2006
if the problem is with the validation, have you tryed to set it to off?
enableEventValidation="false"

 
Reply With Quote
 
 
 
 
Wayne Sepega
Guest
Posts: n/a
 
      01-10-2006
No, but given that it's set to true for security reasons and I would like to
make use of the feature it provides, I did not want to set it to false.

I would rather know why the ClientScript.RegisterForEventValidation is not
working like I understand it should.

Thanks
Wayne


"Henrique Mello" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> if the problem is with the validation, have you tryed to set it to off?
> enableEventValidation="false"
>



 
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 does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
How can I send back(Post back) some values from client machine Joby ASP .Net 0 05-14-2004 04:19 AM
Re: Hey Kathy, a while back didn't you post a little thing to help remember IRQ and DMA assignments? If so please re-post. Geoff A+ Certification 1 02-09-2004 12:14 AM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM
Cisco 2610 back to back serial connection problem - please help pandula Cisco 1 07-10-2003 01:21 PM



Advertisments