I have an ASP.NET page (VB) that has a user control banner at the top and a data grid that pulls from an Access table. What is happening to it makes no sense whatsoever to me because it is unpredictable (the kinds of things that drive programmers up the wall, an error I can deal with, but one that happens only once in a while is insane)
I add the user control by dragging it to the form.
I add a reference to it in my code behind under the 'designer' area as follows
Then I set some Public properties that I have exposed on the control
When I view the page in debug mode (F5) everything comes up, no problem. When I view that page through my browser, everything comes up, no problem. When I hit F5 to refresh I get 'object reference not set to the instance of an object on the first line that references MyMiniBanner. The page won't load. So I sandwiched that in a try block and sent the message to a text box. Now I get the message and the page loads but I don't get my data grid.
Why does it work sometimes and not others? What does that object ref have to do with my datagrid not loading?
This one is annoying!
Any suggestions at all greatly appreciated. I can post the user control code if it would help.
I add the user control by dragging it to the form.
I add a reference to it in my code behind under the 'designer' area as follows
Code:
Protected WithEvents MyMiniBanner As MiniBanner
Then I set some Public properties that I have exposed on the control
Code:
Me.MyMiniBanner.BannerText = "GO VCU Rams!"
Me.MyMiniBanner.BannerVisible = True
Me.MyMiniBanner.BannerStyle = "Banner1"
When I view the page in debug mode (F5) everything comes up, no problem. When I view that page through my browser, everything comes up, no problem. When I hit F5 to refresh I get 'object reference not set to the instance of an object on the first line that references MyMiniBanner. The page won't load. So I sandwiched that in a try block and sent the message to a text box. Now I get the message and the page loads but I don't get my data grid.
Why does it work sometimes and not others? What does that object ref have to do with my datagrid not loading?
This one is annoying!
Any suggestions at all greatly appreciated. I can post the user control code if it would help.