Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with EventValidation with UserControl

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
I have a usercontrol with a button on it. It's supposed to submit the usercontrol data to server.

It gives eventvalidation error, unless I put the enableEventValidation=false as page attribute. To avoid doing that I am trying to register the event.

I use this code:
Page.ClientScript.RegisterForEventValidation(button1.UniqueID, this.ToString());

and it works fine on one page, but not on another.

I also tried using callback functionality, and used:
Page.ClientScript.ValidateEvent(button1.UniqueID, this.ToString());

inside the RaiseCallbackEvent() function.
This also worked fine on one page, but not on others!

I am not able to find the reason for its failure on the 'other' pages. These pages contain many controls, and the code is quite large to place here.

Any pointers on what may be causing the problem?

Thanks a million in advance,
Sheila


 
Found the reason. The form tag was wrongly located!

Sheila
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top