Hi,
I have a big problem.
My current page have no master page, but my project have master page.
I am loading 3 usercontrols dynamically using webmethod and jquery.
code like this
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static string GetReviews()
{
string content;
using (Page page = new Page())
{
UserControl userControl = (UserControl)page.LoadControl("GetReviewsData.ascx");
page.Controls.Add(userControl);
StringWriter sw = new StringWriter();
HttpContext.Current.Server.Execute(page, sw, true);
content = sw.ToString();
}
return content;
}
Page is loaded perfectlly. But I have two textboxes and button in a page. When I entered something on textboxes and click button I got error like this.
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:\Users\Huntable_3\AppData\Local\Temp\Temporary ASP.NET Files\root\dd247138\71070a79\App_Web_jenstl5v.5.cs Line: 0
Stack Trace:
[FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. ]
System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) +10545468
System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) +130
System.Convert.FromBase64String(String s) +41
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose) +66
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter2.Deserialize(String serializedState, Purpose purpose) +8
System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose) +40
System.Web.UI.HiddenFieldPageStatePersister.Load() +127
[ViewStateException: Invalid viewstate.
Client IP: ::1
Port:
Referer: http:
Path: /Home.aspx
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:30.0) Gecko/20100101 Firefox/30.0
ViewState: /wEPDwUKLTU0MDM2MDE2OQ9kFgICAQ8WAh4HZW5jdHlwZQUTbXVsdGlwYXJ0L2Zvcm0tZGF0YRYCAiEPFgIeB1Zpc2libGVoZBgB,/wEPDwUBMA9kFgJmD2QWBAIDD2QWBAIBDxYCHgdWaXNpYmxlaGQCAw8WAh8AaGQCBQ8WAh4LXyFJdGVtQ291bnQCBBYIAgEPZBYEAgEPDxYCHghJbWFnZVVybAUbfi9IdW50YWJsZUltYWdlcy9ub21vcmUuanBnZGQCAg8VBBNDYXBnZW1pbmktSm9icy5hc3B4CUNhcGdlbWluaRNDYXBnZW1pbmktSm9icy5hc3B4AzMyNWQCAg9kFgQCAQ8PFgIfAgUbfi9IdW50YWJsZUltYWdlcy9ub21vcmUuanBnZGQCAg8VBBtKb2huc29uLSYtSm9obnNvbi1Kb2JzLmFzcHgRSm9obnNvbiAmIEpvaG5zb24bSm9obnNvbi0mLUpvaG5zb24tSm9icy5hc3B4AzEzNmQCAw9kFgQCAQ8PFgIfAgUbfi9IdW50YWJsZUltYWdlcy9ub21vcmUuanBnZGQCAg8VBA9Ob2tpYS1Kb2JzLmFzcHgFTm9raWEPTm9raWEtSm9icy5hc3B4AzExMGQCBA9kFgQCAQ8PFgIfAgUXfi9Mb2FkRmlsZS5hc2h4P2lkPTE5OTlkZAICDxUEDUNHUy1Kb2JzLmFzcHgDQ0dTDUNHUy1Kb2JzLmFzcHgBMWRkUO+IzCsawxD48EFtlY5TC1dOkyDTdoCnPYBnnCkvda0=BR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAw...]
[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) +198
System.Web.UI.HiddenFieldPageStatePersister.Load() +266
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +88
System.Web.UI.Page.LoadAllState() +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6704
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245
System.Web.UI.Page.ProcessRequest() +72
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +58
ASP.home_aspx.ProcessRequest(HttpContext context) in c:\Users\Huntable_3\AppData\Local\Temp\Temporary ASP.NET Files\root\dd247138\71070a79\App_Web_jenstl5v.5.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
Please help me...
Thanks...