Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 671
  • Last Modified:

C# ASP.NET ascx control

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
zintech
Asked:
zintech
1 Solution
 
Rose BabuSenior Team ManagerCommented:
Have a look on this solution

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

it will work for you.
0
 
BuggyCoderCommented:
The error is because the report viewer instance is null...
http://stackoverflow.com/questions/5378777/findcontrol-in-ascx-usercontrol
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now