Click to See Complete Forum and Search --> : Trying to access Session State w/ JS popup


wylbur
04-23-2006, 10:30 PM
Hi,

I'm trying to access Session State with C# from a popup window
opened with JavaScript, and I'm getting the following error.

Why do I have the feeling that I can't do this?

If I can't, then my next question will be:
How can I store the stuff that the popup window collects
in hidden data fields on the opening page in a secure manner,
then access them from ASP.NET on postback?

I know about the opener object in JavaScript, and I can
force a postback event on the opening page from the popup
with a JavaScript function, but I don't know how to access
the hidden data variables from the webpage with ASP.NET.

Thanks in advance!



The error page:
#######################################################################################
#######################################################################################
#######################################################################################

Server Error in '/Webfolder01' Application.
--------------------------------------------------------------------------------

The state information is invalid for this page and might be corrupted.
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.Web.HttpException: The state information is invalid
for this page and might be corrupted.

Source Error:


[No relevant source lines]


Source File: c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
\webfolder01\4d30b6b5\585efd3a\App_Web_oaa9a0iz.0.cs Line: 0

Stack Trace:


[FormatException: Invalid character in a Base-64 string.]
System.Convert.FromBase64String(String s) +0
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +72
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize
(String serializedState) +4
System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter,
String serializedState) +37
System.Web.UI.HiddenFieldPageStatePersister.Load() +140

[ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port: 1110
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
.NET CLR 1.1.4322; .NET CLR 2.0.50727)
ViewState: [a bunch of stuff]
Referer: http://localhost/Webfolder01/CtrlInit/CtrlInit12b.aspx
Path: /Webfolder01/CtrlInit/CtrlInit12b.aspx]

[HttpException (0x80004005): The state information is invalid for this page
and might be corrupted.]
System.Web.UI.ViewStateException.ThrowError(Exception inner,
String persistedState, String errorPageMessage,
Boolean macValidationError) +116
System.Web.UI.HiddenFieldPageStatePersister.Load() +240
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
System.Web.UI.Page.LoadAllState() +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +6953
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +154
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.ctrlinit_ctrlinit12b_aspx.ProcessRequest(HttpContext context)
in c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
\webfolder01\4d30b6b5\585efd3a\App_Web_oaa9a0iz.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication
.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) +64




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42
#######################################################################################
#######################################################################################
#######################################################################################



Thanks in advance!