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
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.
Infragistics has confirmed that another (related) bug is still in the current hotfix release (Build 2039) which is tracked unter issue number 13143. The issue sould be resolved in the next hotfix release planned for the last week in march. So long you can use the above workaround.
I still have this problem even after the Jan 2009 hot fix.
I ran into the same problem with a SharePoint webpart and adding the below line of code to the CreateChildControls() fixes this for now.
HttpContext.Current.Items["_webGridDocType"] = RenderDtdType.Html40Transitional;
Hope this helps.Doug