473,394 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

RegisterForEventValidation can only be called during Render()

I’ve been getting this error after converting my app from .NET 1.1 to .Net 2.0.
RegisterForEventValidation can only be called during Render()
An error occurs when I call RenderControl(oHtmlTextWriter) method.
Can’t use EnableEventValidation="false".
Any help is appreciated.
Thanks

Jul 17 '06 #1
2 11867
Hi,

there's no pure workaround since controls register their arguments for event
validation at render. You would need to either override the check on control
level (basically override rendering) or disable event validation. If your
code tries to render the control before the entire page is on Render stage,
you get this error, and it is as the error msg states.

If you can move the logic to do the call to RenderControl etc in Page's
overridden Render method, that could serve as a workarounnd, but it depends
on your scenario can it be applied.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Albert" <Al****@discussions.microsoft.comwrote in message
news:EC**********************************@microsof t.com...
I've been getting this error after converting my app from .NET 1.1 to .Net
2.0.
RegisterForEventValidation can only be called during Render()
An error occurs when I call RenderControl(oHtmlTextWriter) method.
Can't use EnableEventValidation="false".
Any help is appreciated.
Thanks

Jul 17 '06 #2
Hi,
Thanks for response.
I’ve read all about it.
It’s not going to work in my case.
What I’ll do ,I will override Page.EnableEventValidation property.
public override bool EnableEventValidation {
get {
if (Request.Params["aa"].Trim().Equals("sss")) {
return false; }
else {
return base.EnableEventValidation; }
}
set { base.EnableEventValidation = value; } }

This way I’ll pragmatically control it at least .

"Teemu Keiski" wrote:
Hi,

there's no pure workaround since controls register their arguments for event
validation at render. You would need to either override the check on control
level (basically override rendering) or disable event validation. If your
code tries to render the control before the entire page is on Render stage,
you get this error, and it is as the error msg states.

If you can move the logic to do the call to RenderControl etc in Page's
overridden Render method, that could serve as a workarounnd, but it depends
on your scenario can it be applied.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Albert" <Al****@discussions.microsoft.comwrote in message
news:EC**********************************@microsof t.com...
I've been getting this error after converting my app from .NET 1.1 to .Net
2.0.
RegisterForEventValidation can only be called during Render()
An error occurs when I call RenderControl(oHtmlTextWriter) method.
Can't use EnableEventValidation="false".
Any help is appreciated.
Thanks


Jul 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Tomas | last post by:
Is there any sequence diagram on the web that clearly shows in which order all Page methods (load, render and so on) are being called compared to the order the page's contained control methods are...
2
by: Sam | last post by:
I have a custom control (MyTextBox - taken from Microsoft website) that implements the IPostBackDataHandler interface. It is added to the controls collection of a placeholder control during the...
1
by: ScottF | last post by:
There was a problem with ASP.Net 1.1 creating/generating bad javascript on html pages that I ran into and on the KB page that I had found at the time it said that the problem was fixed in the .Net...
2
by: stewart | last post by:
Hi. I have an asp:dropdown control to which I add items on the client, when the page is posted back I get this error message. Invalid postback or callback argument. Event validation is enabled...
3
by: n33470 | last post by:
Hi all, I have a dropDownList on a web page that is populated by client-side script. I get an error on PostBack of the page. I've seen quite a few posts about this, so I understand the issue,...
0
by: smkkaleem | last post by:
I am stuck with the error I have posted above in the question title I am developing ASP.NET 2.0 web site and I have added a new rdlc file to my project by using the following process: -Right...
7
by: Varangian | last post by:
Hi all, I have a question, what does the function ClientScriptManager.RegisterForEventValidation really does? Does it means securing your client side code? more security? The question is how...
3
by: wind | last post by:
i use the code in exporting gridview to excel and and work just fine but when i adjust it to my implementation of a search record I'm getting the said error (registerforeventvalidation can only be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.