[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Help with Overriding classes

Posted on 2008-11-20
8
Medium Priority
?
341 Views
Last Modified: 2013-11-07
Hi Experts,

I have a web page written in c#, and I'm trying to enable a gridview to be exported to Excel. In order to do this, I need to override a certain class: VerifyRenderingInServerForm. The page itself derives System.Web.UI.UserControl, and when I try to override VerifyRenderingInServerForm I get this error on that line of code:

No suitable method found to override
(code attached)

Could you explain what's going on, and how I can override this method so I can export the gridview to Excel?

Many thanks. It's super urgent please. Thank you!!

rss2
exporttoexcel.txt
0
Comment
Question by:rss2
  • 4
  • 3
8 Comments
 
LVL 8

Expert Comment

by:OBonio
ID: 23002443
This method is only available at the Page level, not on UserControl.


0
 

Author Comment

by:rss2
ID: 23002459
How do I export a gridview to excel when the page is derived from UserControl? How could I make this work? Thanks.
0
 
LVL 5

Expert Comment

by:suganthkumar
ID: 23002464
Hi,

You cannot override the function in this class because the UserControl class does not have the function  "VerifyRenderingInServerForm" which is a functionality for the Page class. either you have to use the Page class itself for this purpose or, you have to override this function in the target page class where you use your user control.

Regards
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 5

Accepted Solution

by:
suganthkumar earned 2000 total points
ID: 23002471
Here is another posting regarding similar requirement

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22879804.html

Regards
0
 

Author Comment

by:rss2
ID: 23002761
suganthkumar,

The link you posted is the kind of solution I'm looking for, so thank you for that. Unfortunately, I'm getting the following error:
".. type GridView must be placed inside a form tag with runat=server"
..which is the reason for overriding VerifyRenderingInServerForm method.

Could you tell me how to make this work?

My code is attached.

Thank you,
rss2

exporttoexcel.txt
0
 

Author Comment

by:rss2
ID: 23002787
suganthkumar, although the solution you found for me didn't fix my problem 100%, it got me to look around and try other things. So giving you credit. Thank you.

I found putting these two solutions together did the trick:

http://aspalliance.com/771
and
http://johnnycoder.com/blog/2008/07/25/export-gridview-to-excel-within-an-updatepanel/

Thanks for your help! :)
0
 

Author Closing Comment

by:rss2
ID: 31518619
The solution did not solve the problem, but it got me to look for other things and I came across the solution independently. I posted the solution, but giving suganthkumar credit for helping.
0
 
LVL 5

Expert Comment

by:suganthkumar
ID: 23003090
Hi rss2,

Great to hear that you got the solution

Regards
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses
Course of the Month17 days, 17 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question