Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
NullReferenceException in WebGrid after migration to v8.3 - A bug?
posted

Hello,

after upgrading an application from NetAdvantage v8.1 CLR 2 to NetAdvantage v8.3 CLR 3.5 I get a NullReferenceException when running the WebPart on a SharePoint WebPart-Page. Running the same WebPart on a ASP.NET page with a WebPart zone is no problem.

Here an example stack trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.IdentifyDocumentType(Page p) +121
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.Initialize() +73
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.Control_Init() +15
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.OnInit(EventArgs e) +42
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Control.InitRecursive(Control namingContainer) +210
   System.Web.UI.Control.InitRecursive(Control namingContainer) +210
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +198
   System.Web.UI.ControlCollection.Add(Control child) +80
   myFramework.Web.UI.WebPart.ChangeReplaceableUserControl(String virtualPathToControl) +500
   myFramework.Web.UI.WebPart.CreateChildControls() +305
   myApplication.myWebPart.CreateChildControls() +384
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +44
   System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

I get the error in several WebParts with different grid-definitions and I changed nothing else than the NetAdvantage version.

I investigated the problem a little bit and find out that the implementation of the method Infragistics.WebUI.UltraWebGrid.UltraWebGrid.IdentifyDocumentType(Page p) has significantly changed from v8.1 to v8.3. The SharePoint master page we are using has no doctype defined, the IE is in quirksMode. Adding a doctype to the master somewhere in the HTML markup solves the problem but is no possibility for us. It seems to me as if this is a bug in the WebGrid implementation?!

I would debug the problem but I have no debug symbols for the assemblies provided by Infragistics. Compile the source code myself and use theis would be time consuming. Why does Infragistics does not provide the debug symbols with the source code package?

Any ideas if this is a bug or if I did something wrong?

Thanks for your help, best regards

simon
Parents
No Data
Reply
  • 130
    posted

    I got the same exception as above when I upgraded from 2007 V1 CLR 2 to 2008 V3 CLR 3.5.  Interstingly, it is only happening on certain pages.  It does happen 100% of the time on those pages though and is completely reproduceable.

    In my case, this happens when I have an UltraWebGrid on the same page as an ASP.NET Wizard control and am using the XHTML doctype:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    And have specified linking in a stylesheet like this:

    <?xml-stylesheet href="MyStylesheet.css" type="text/css"?>

    That line is actually above the doctype line in my aspx.  If it comes after the doctype, the styling doesn't happen...but the exception doesn't either.

    If I remove the above stylesheet line, the exception goes away, but styling doesn't happen.  If I remove the stylesheet line and change the doctype to this:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

    I get styling and the exception does not occur.  I get styling because I also have a link for the stylesheet like this inside the head element:

    <link href="MyStylesheet.css" rel="stylesheet" type="text/css" />

    What is odd is that it appears that the ASP.NET Wizard control is also involved because I can have the XHTML doctype and the stylesheet link, but if I remove the Wizard, I won't get the exception.

    Simply changing the doctype isn't a good solution for me though because this problem is occuring for me with an UltraWebGrid and Wizard on a user control and that user control may be used on pages I can't control the doctype on.

    I have a support case going for this and have provided a web site project demonstrating the problem.  Hopefully they can provide a fix.

Children