2

I'm posting data to a 3rd party website via button click on a aspx page with a masterpage.

However when I post my data the __VIEWSTATE variable is being passed along in the post. I don't wish to remove the Viewstate for the page. I just want to not pass along the __VIEWSTATE variable in a post.

Is there a way to do this?

Prescient
  • 1,051
  • 3
  • 17
  • 42
  • 1
    http://www.devcurry.com/2011/02/remove-viewstate-from-aspnet-page.html and http://stackoverflow.com/questions/2432972/completely-remove-viewstate-for-specific-pages might help you – Vinod Jul 10 '14 at 05:39

2 Answers2

2

I've gone with moving the Viewstate to session via pagestatepersister override.

/// <summary>
/// Move viewstate to session
/// </summary>
protected override PageStatePersister PageStatePersister
{
    get
    {
        return new SessionPageStatePersister(Page);
    }
}

http://brianreiter.org/2010/02/24/override-pagestatepersister-to-eliminate-viewstate/

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Prescient
  • 1,051
  • 3
  • 17
  • 42
0

You can maybe do a reverse proxy which means you post to an internal page that in turn posts to the external page with the parameters you want to include.

TGH
  • 38,769
  • 12
  • 102
  • 135
  • gah. I guess I could post from the codebehind. but I wanted to avoid doing more coding. I guess that's unavoidable. – Prescient Jul 09 '14 at 19:46