[CLOSED] Hidden field problem
Hi,
I have a simple hidden field in my application:
Code:
<ext:Hidden ID="someID" runat="server">
</ext:Hidden>
It is located on a control that is not initially visible. I receive the following exception during the page initial load:
Code:
General Error: 0 : Timestamp: 2008-12-10 14:49:35
Message:
Category: General
Priority: 1
EventId: 0
Severity: Error
Title:
Machine: MASTER
App Domain: 77da83f8-3-128733940574779759
ProcessId: 13200
Process Name: C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.EXE
Thread Name:
Win32 ThreadId:21152
Extended Properties: Exception - System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Coolite.Ext.Web.Hidden.set_Value(Object value)
at Coolite.Ext.Web.Hidden.LoadPostData(String postDataKey, NameValueCollection postCollection)
at Coolite.Ext.Web.Field.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\idfmc\fff803cd\97ac1b45\App_Web_xiki32au.0.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
AuthenticationType - Forms
IdentityName - admin
IsAuthenticated - True
The exception is thrown only when StateProvider="PostBack". It is not thrown when StateProvider="None". (StateProvider="Cookie" is not working for some reason with AjaxEvents for us, but it's another story).
Is there a way to get rid of that exception?
Regards,
Tadeusz
RE: [CLOSED] Hidden field problem
Hi*Tadeusz,
I tried a few thing but could not get the exception. Can you post a simplified .aspx sample that demonstrates how to reproduce the problem? I'll try a few more things, but I think we're going to have to see exactly how you have things configured.*
Thanks for reporting the problem.*
RE: [CLOSED] Hidden field problem
Hi Geoffrey,
I wasn't able to replicate it outside of our application (it is a bit complex with third party controls), but I have fixed the problem in your sources (Hidden.cs):
Code:
public override object Value
{
get
{
return (string)this.ViewState["Value"] ?? "";
}
set
{
this.ViewState["Value"] = value != null ? value.ToString() : string.Empty;
}
}
(BTW when I replaced all hidden fields with hidden labels, it worked fine too, but we prefer hidden fields for our purpose)
It would be great having this fix in the official version.
Regards,
Tadeusz
RE: [CLOSED] Hidden field problem
Hi Taduesz,
I believe this problem might be related to the following bug fix, see*http://forums.ext.net/showthread.php...=5397-5-1.aspx
If you get a chance, please svn update and confirm if your code is now working correctly.*
Hope this helps.
RE: [CLOSED] Hidden field problem
Hi,
It is working all right. Thanks.
Tadeusz