Solved

C# ASP.NET ascx control

Posted on 2012-03-27
2
657 Views
Last Modified: 2012-06-27
I have an ASP.NET page that has a user control .ascx page inside of it.  The .ascx page has a report viewer and a button in it that when clicked displays a report on the report viewer.  When I click the button that is actually inside of the .ascx control, the report displays just fine.  However I have a separate button that is just on the .aspx page itself, and when this button is clicked I call the Button1_Click(sender, e) method of the .ascx which should display the report.  However, I get an "Object reference not set to an instance of an object" error message on the first line of the code on the Button in the .ascx page.  The first line tells the report viewer to reset.  

Am I calling the method wrong?  Or am I missing something?
0
Comment
Question by:zintech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Expert Comment

by:Rose Babu
ID: 37771390
Have a look on this solution

http://forums.asp.net/p/1608054/4105031.aspx

it will work for you.
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
ID: 37771395
The error is because the report viewer instance is null...
http://stackoverflow.com/questions/5378777/findcontrol-in-ascx-usercontrol
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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