Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Desperate repost: Reloading page too quickly results in an error

Reply
Thread Tools

Desperate repost: Reloading page too quickly results in an error

 
 
Walter
Guest
Posts: n/a
 
      12-20-2003
Each of the aspx pages in my application have a User Control called
"WrapStart".

In a page's Page_Load() method, I set various properties and/or call
various methods of the WrapStart control object. Everything works
fine... except...

....when I click too quickly from one page to another (or quickly
reload the same page). When I do, I get the following error:

"Object reference not set to an instance of an object."

And the line highlighted in the error is: WrapStart.someMethod();


I'm wondering what is going on and how do I fix this problem. Any
help would be greatly appreciated.


 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      12-21-2003
Have you tried setting the user control as an data member within your
derived class (ie the custom page)
or are you relying on Page.FindControl to get its instance ?

I think declaring it as a data member should ease the problem cause it will
be initialised and bound correctly in the constructor

public class CA_ShowProductStock : System.Web.UI.Page
{
protected System.Web.UI.WebControls.LinkButton lnkBack;
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected WebShop.ShopAdmin.Label ModuleTitle1;

The html view on the aspx file has the user control id as ModuleTitle1.
Let us know how you get on with it...

Hope this helps,

HD


"Walter" <(E-Mail Removed)> wrote in message
news:6j4Fb.26506$(E-Mail Removed) ...
> Each of the aspx pages in my application have a User Control called
> "WrapStart".
>
> In a page's Page_Load() method, I set various properties and/or call
> various methods of the WrapStart control object. Everything works
> fine... except...
>
> ...when I click too quickly from one page to another (or quickly
> reload the same page). When I do, I get the following error:
>
> "Object reference not set to an instance of an object."
>
> And the line highlighted in the error is: WrapStart.someMethod();
>
>
> I'm wondering what is going on and how do I fix this problem. Any
> help would be greatly appreciated.
>
>



 
Reply With Quote
 
 
 
 
Walter
Guest
Posts: n/a
 
      12-22-2003
This is the way it already is accessed.

"Hermit Dave" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Have you tried setting the user control as an data member within your
> derived class (ie the custom page)
> or are you relying on Page.FindControl to get its instance ?
>
> I think declaring it as a data member should ease the problem cause it

will
> be initialised and bound correctly in the constructor
>
> public class CA_ShowProductStock : System.Web.UI.Page
> {
> protected System.Web.UI.WebControls.LinkButton lnkBack;
> protected System.Web.UI.WebControls.DataGrid DataGrid1;
> protected WebShop.ShopAdmin.Label ModuleTitle1;
>
> The html view on the aspx file has the user control id as ModuleTitle1.
> Let us know how you get on with it...
>
> Hope this helps,
>
> HD
>
>
> "Walter" <(E-Mail Removed)> wrote in message
> news:6j4Fb.26506$(E-Mail Removed) ...
> > Each of the aspx pages in my application have a User Control called
> > "WrapStart".
> >
> > In a page's Page_Load() method, I set various properties and/or call
> > various methods of the WrapStart control object. Everything works
> > fine... except...
> >
> > ...when I click too quickly from one page to another (or quickly
> > reload the same page). When I do, I get the following error:
> >
> > "Object reference not set to an instance of an object."
> >
> > And the line highlighted in the error is: WrapStart.someMethod();
> >
> >
> > I'm wondering what is going on and how do I fix this problem. Any
> > help would be greatly appreciated.
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Can python quickly display results like bash? Chris Rebert Python 2 03-17-2009 08:52 PM
Can python quickly display results like bash? robert song Python 0 03-17-2009 01:05 AM
session state variables expiring too quickly bennett@peacefire.org ASP .Net 3 06-28-2005 11:00 AM
session variable expire too quickly =?Utf-8?B?QUNhdW50ZXI=?= ASP .Net 1 01-13-2005 10:10 PM
onunload call when reloading page quickly nic den Javascript 0 07-30-2003 03:15 PM



Advertisments