473,503 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RegisterForEventValidation can only be called during render

1 New Member
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 called during render)how will i resolved these problem without setting the EnableEventValidation to false.
Mar 31 '07 #1
3 19431
kenobewan
4,871 Recognized Expert Specialist
You can turn paging and/or sorting off, rebind the grid, export to Excel, then turn paging and/or sorting back on. If you have a multi-page gridview, this will render it to one page for export to Excel and then render it back to where it was. The down side is that it could be a bit slow for large text files.

GridView.AllowPaging = False
GridView.AllowSorting = False
GridView.DataBind()

' Your export routing goes here

GridView.AllowPaging = True
GridView.AllowSorting = True
GridView.DataBind()
Apr 3 '07 #2
jon1234
1 New Member
Using this technique, it seems that no data is being saved to the spreadsheet, however, the render error no longer appears. Any ideas?
Apr 16 '07 #3
inderjeetsinghsethi
1 New Member
Just Write down at page directive
is
EnableEventValidation = "false"
Feb 27 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
17943
by: chrism | last post by:
Hello, I have a pop-up window that I would like to appear in front of the browser home page when a user opens IE. Problem is, I'd like it to never appear again if the user navigates back to the...
1
1469
by: kosta | last post by:
hello! I have this code: public static DataSet DSet(String sql) { OleDbConnection con = new OleDbConnection(); con.ConnectionString = ConfigurationSettings.AppSettings; OleDbCommand cmd =...
2
1537
by: Jeti [work] | last post by:
I'm using ASP.NET (Framework 1.1), and have encountered folowing problem: I have testing page: "testing.aspx", and i have created two controls (register and htmlEditor). register control...
1
1214
by: bhavin30 | last post by:
Hi Guys, I have a quick question. I think code will explain it the best. This is what I am doing for one of the columns during databinding on my grid: <asp:TemplateColumn> <HeaderStyle...
2
11873
by: Albert | last post by:
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 ...
3
3571
by: Techsatish | last post by:
how to make a mouseup event called only once during a double click event? here double click is made on a tree node in a tree control. I have the code inside mouseup event....in runtime the...
2
1400
by: andrew | last post by:
what happens with the code from the catch block ? is it interrupted by the ThreadAbortException ? void ThreadProc( ) { try { } catch(Exception ex)
5
1576
by: jbaranski | last post by:
Access 2003 (2000 File Format) I have a very complex string of queries (8 queries are ran when att empting to run the final Crosstab) and am receiving something odd on the 2nd to last one; a Union...
9
1490
by: holysmoke | last post by:
Hi all, I have a function void actualfunction(unsigned int t, unsigned int lineno) { .... } I want that it is called only from a macro I wrote for it (I don't want to use a wrapper...
0
7203
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
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.