[CLOSED] Hidden field problem

  1. #1

    [CLOSED] Hidden field problem

    Hi,

    I have a simple hidden field in my application:

    <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:

    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&amp; 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
  2. #2

    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. 


    Geoffrey McGill
    Founder & CEO
  3. #3

    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):


     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


  4. #4

    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.




    Geoffrey McGill
    Founder & CEO
  5. #5

    RE: [CLOSED] Hidden field problem

    Hi,

    It is working all right. Thanks.

    Tadeusz

Similar Threads

  1. [CLOSED] Hidden field affects layout, why?
    By CarpFisher in forum 2.x Premium Help
    Replies: 9
    Last Post: May 10, 2012, 2:25 PM
  2. Hidden Field and preset Value causes error
    By Bubu in forum 1.x Help
    Replies: 3
    Last Post: Feb 13, 2012, 1:00 AM
  3. [CLOSED] Problems with Hidden Field after SVN Update
    By macap in forum 1.x Premium Help
    Replies: 9
    Last Post: May 23, 2011, 11:12 AM
  4. Replies: 0
    Last Post: May 06, 2010, 4:20 PM
  5. [CLOSED] Hidden field question
    By Jurke in forum 1.x Premium Help
    Replies: 2
    Last Post: Dec 12, 2008, 9:18 AM

Posting Permissions