Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / January 2008

Tip: Looking for answers? Try searching our database.

Viewstate expires

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Davoli - 31 Jan 2008 14:54 GMT
I wqas told to put a machine key into the web config so it would do the
encryption the same. I did that and I still get the following error. Any
other suggestions?

I store some stuff in view state and then if I leave the browser instance
alone say for 20 minutes, it gives me this message when I go to retrieve from
viewstate. Before it expires it works perfectly. Is there anything I can do
to not have it expire? Or what is it doing?

IT HIGHLIGHTS IN RED LINE 334

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:

Line 332:            End If
Line 333:
Line 334:            If
ViewState("SpecialInstructions").ToString.Trim.Length > 0 Then
Line 335:                lblSpecialInstructions.Text =
ViewState("SpecialInstructions").ToString
Line 336:                pnlSpecialInstructions.Visible = True


Signature

Chris Davoli

bruce barker - 31 Jan 2008 16:35 GMT
are you checking IsPostback before accessing viewstate for saved values?

most likely you have redirect logic on expired session or authentication,
and the page request is a get (no viewstate passed).

-- bruce (sqlwork.com)

> I wqas told to put a machine key into the web config so it would do the
> encryption the same. I did that and I still get the following error. Any
[quoted text clipped - 25 lines]
> Line 336:                pnlSpecialInstructions.Visible = True
>  

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.