• Sign In
 
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...
Common Tasks
  • Blog Home
  • Email Blog Author
  • RSS for comments
  • RSS for posts
Search
  • Advanced search options...
Tags
  • .NET Framewor
  • .NET Framework
  • Ajax/Javascript
  • ASP.NET
  • CLR
  • Cool stuff
  • DataAccess
  • Debugging/Windbg
  • Hotfix/Service Pack
  • IDEVDataCollector
  • IIS
  • Internet Explorer
  • Italian techs
  • LogParser
  • OT
  • Personal
  • Productivity
  • Random
  • Scripting/ASP
  • Security
  • Technology
  • Tools
  • Troubleshooting
  • Vista/Longhorn
  • Visual Studio
Archives
Archives
  • November 2010 (1)
  • October 2010 (1)
  • July 2010 (2)
  • April 2010 (1)
  • March 2010 (2)
  • February 2010 (2)
  • January 2010 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (1)
  • July 2009 (5)
  • June 2009 (1)
  • May 2009 (1)
  • April 2009 (3)
  • March 2009 (3)
  • February 2009 (5)
  • January 2009 (3)
  • December 2008 (5)
  • November 2008 (3)
  • October 2008 (2)
  • September 2008 (3)
  • August 2008 (3)
  • July 2008 (3)
  • June 2008 (5)
  • May 2008 (4)
  • April 2008 (8)
  • March 2008 (4)
  • February 2008 (5)
  • January 2008 (2)
  • December 2007 (4)
  • November 2007 (6)
  • October 2007 (6)
  • September 2007 (8)
  • August 2007 (6)
  • July 2007 (7)
  • June 2007 (10)
  • May 2007 (9)
  • April 2007 (12)
  • March 2007 (8)
  • February 2007 (5)
  • January 2007 (3)
  • December 2006 (1)
  • November 2006 (4)
  • October 2006 (2)
  • September 2006 (9)
  • August 2006 (2)
  • July 2006 (1)

ASP.NET 2.0 posts back to ASP.NET 1.1: supported?

MSDN Blogs > Never doubt thy debugger > ASP.NET 2.0 posts back to ASP.NET 1.1: supported?

ASP.NET 2.0 posts back to ASP.NET 1.1: supported?

Carlo Cardella
7 Feb 2007 7:17 AM
  • Comments 1

Last week I got an interesting question from a customer, apparently easy but something I really had never thought before...

They have some ASP.NET 1.1 applications running in their environment, while the new apps they are currently developing, are based on ASP.NET 2.0: from one of those new pages they need to post some form values to an ASP.NET 1.1 page (both running on the same Win2003 server but in different application pools, to avoid the limitation of having just one CLR version per process); they use cross-page postback through the PostBackPage property for the submit button to target the 1.1 page, but this throws an InvalidCastException on LoadPageViewState() (which I guess is expected since 1.1 and 2.0 Viewstates are encoded differently).

Question: is this scenario supported at all? How could this work? Well... it turns out that the ASP.NET 1.1 and 2.0 viewstate are encoded differently and are not compatible; moreover even if you set EnableViewState="false" at page level this does not completely turns viewstate off, so every time you'll execute the page you'll get the InvalidCastException as before.

Based on customer's requirements, we identified the following possible solutions:

  • POST from a classic ASP or HTML page: of course, since there is no viewstate posted with the form, we also don't get the exception
  • From 2.0 POST to the same page (ASP.NET default, without using CrossPagePostback) and then do a server side Response.Redirect() to the target 1.1 page passing the parameters to the Query String. Unfortunately it's not possible to use Server.Transfer() because this works only between pages in the same application (while here we had two separate applications). Using the query string is not the best approach if you need to pass sensitive values...
  • If the target page does not need to rely on viewstate, override the LoadPageStateFromPersistenceMedium() method (we simply returned an empty object) so the posted viewstate will be ignored and we'll not throw the InvalidCastException; this has the advantage to be a "standard" POST (we don't use the query string) so the values are not passed in clear text

Probably I'm missing some other possible solutions, but the above (the latest point) at least fit the customer's requirements...

 

Cheers

  • 1 Comments
ASP.NET
Leave a Comment
  • Please add 6 and 4 and type the answer here:
  • Post
Comments
  • Michael's Coding Den
    13 Jun 2007 3:17 PM

    Last update: June 13 , 2007 Document version 0.6 Preface If you have something to add, or want to take

Page 1 of 1 (1 items)
  • © 2012 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy Statement
  • Report Abuse
  • 5.6.402.223