Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. System.Web.HttpException: The View State is invalid for this page and might be corrupted.

System.Web.HttpException: The View State is invalid for this page and might be corrupted.

Scheduled Pinned Locked Moved ASP.NET
3 Posts 3 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Venkatraman
    wrote on last edited by
    #1

    I want to post the form contents to another page. This function would be called from a hyperlink. When we click that link it should do the form posting and submit. function post() { document.frmLogin.action = "../common/FormRedirector.aspx"; document.frmLogin.submit(); } when i do this i am getting System.Web.HttpException: The View State is invalid for this page and might be corrupted. Cheers, Venkatraman Kalyanam Chennai - India "Being Excellent is not a skill, it is an attitude"

    N 1 Reply Last reply
    0
    • V Venkatraman

      I want to post the form contents to another page. This function would be called from a hyperlink. When we click that link it should do the form posting and submit. function post() { document.frmLogin.action = "../common/FormRedirector.aspx"; document.frmLogin.submit(); } when i do this i am getting System.Web.HttpException: The View State is invalid for this page and might be corrupted. Cheers, Venkatraman Kalyanam Chennai - India "Being Excellent is not a skill, it is an attitude"

      N Offline
      N Offline
      Natty Gur
      wrote on last edited by
      #2

      Venkatraman Hi, Part of the form that you are sending contains the view state of the current page (the __ViewState hidden field), for the PostBack machinery. While page is load on the server side the ASP.NET read the viewstate hidden field to set the controls value. Your problem is that the target page can’t translate the __viewstate field to the target page controls and you get your error. To overcome it try to: 1) Remove viewstate, if you don’t use it. 2) Create new form with javascript that will send the necessary fields. 3) User server side event to catch the click. Use Server.Transfer to move into the target page. Send the Form data view Context

      V 1 Reply Last reply
      0
      • N Natty Gur

        Venkatraman Hi, Part of the form that you are sending contains the view state of the current page (the __ViewState hidden field), for the PostBack machinery. While page is load on the server side the ASP.NET read the viewstate hidden field to set the controls value. Your problem is that the target page can’t translate the __viewstate field to the target page controls and you get your error. To overcome it try to: 1) Remove viewstate, if you don’t use it. 2) Create new form with javascript that will send the necessary fields. 3) User server side event to catch the click. Use Server.Transfer to move into the target page. Send the Form data view Context

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        Hey Natty Gur, I also get this error sometimes. But I am not able to reproduce it and is quite vagarious in its occurence. Normally a Rebuild All solves the problem. Does this because, Building and Deploying [Debug] causes Sessions to reset and ViewStates to get set to null? Deepak Kumar Vasudevan http://deepak.portland.co.uk/

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups