Server.Transfer("xxxx.aspx",true) error

Results 1 to 3 of 3

Thread: Server.Transfer("xxxx.aspx",true) error

  1. #1
    Join Date
    Dec 1969

    Default Server.Transfer("xxxx.aspx",true) error

    I am trying to transfer control to a new page after posting and validating the returned data from my page using:<BR>If Page.IsPostBack = True Then<BR> Page.Validate()<BR> If Page.IsValid = True then<BR> Server.Transfer("MyNewPage.aspx", True)<BR> End If<BR>End If<BR><BR>When Handled, I keep receiving the error<BR>5: Error executing child request for MyNewPage.aspx<BR><BR>When unhandled, I receive the following:<BR>The View State is invalid for this page and might be corrupted.<BR><BR>Has anyone experienced this before (and better yet, how did you work around it?).<BR><BR>Thanks in advance!

  2. #2
    Join Date
    Dec 1969

    Default RE: Server.Transfer(

    I&#039;ve had the "viewstate is invalid" error from time to time, but it seems to only happen when I trip some other error, to the the source and fix it, then go back and refresh the page. If I shut down the browser when I get an error, fix it and re-open, it doens&#039;t seem to occur.<BR><BR>I ran your code (without the validate() since I didn&#039;t have it) and it transfers to a new file with no problem.<BR><BR>You might try commenting out any "Try/Catch" code you have in your original page to see if an error is occuring somewhere else.<BR><BR>Good Luck<BR>Tt<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Question for ya

    Do you have any code running in your method after Server.Transfer?<BR><BR>If so, you&#039;ll have to work around this. Even though you&#039;ve<BR>Server.Transfer&#039;ed, it will continue through the method after execution which can generate out of place errors such as this and thread aborted errors. These are eroneous errors.<BR><BR>I&#039;ve often placed Exit Function/Exit Sub statements right<BR>after the Server.Transfer call. But, it isn&#039;t full proof.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts