Page Not Found NullReferenceException

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/13/2013 2:54:46 PM
Gravatar
Total Posts 30

Page Not Found NullReferenceException

What operating system? Server=Windows Server 2003 / SP3 / IIS 6; Client=Windows 7 / SP1
What database platform? MS SQL 2008
What version of mojoPortal? Upgrading from 2.3.9.4 to 2.3.9.7
What version of .NET? 4.0
Steps to produce the problem, expected results, and actual results.

On previous version (2.3.9.4) we created a custom page not found, per the instructions (https://www.mojoportal.com/customizing-the-404-page-not-found-page) putting our own text and links inside the main <div>. After upgrading to 2.3.9.7 the custom page is throwing errors - "XML Parsing Error: no element found". But we can hit the included/default pagenotfound.aspx. So we copied our custom text over and pagenotfound.aspx throws errors in IIS about unhandled exception, NullReferenceException, and Object reference not set to an instance of an object.

Upon narrowing it down, it seems there is a change such that it is now required to have this line: <asp:Literal ID="litErrorMessage" runat="server" EnableViewState="false" />. Whenever we take that out, we get the errors. However, previously that was not the case. Seems that forces us to keep the default error message/text rather than be able to customize the page.

Thanks in advance!

6/13/2013 3:22:32 PM
Gravatar
Total Posts 18439

Re: Page Not Found NullReferenceException

You could just set Visible="false" on the Literal if you don't want to show it.

Hope that helps,

Joe

6/13/2013 3:36:14 PM
Gravatar
Total Posts 30

Re: Page Not Found NullReferenceException

Joe, thanks that does help. Didn't think of that... =) It might be a good idea to update the custom page not found instructions (https://www.mojoportal.com/customizing-the-404-page-not-found-page) with the requirement for that asp literal line to stay in.

One more thing on our custom page, before upgrading we created a link to the Site Map using: <asp:HyperLink ID="lnkSiteMap" runat="server" CssClass="txterror pnflink" />. That's not working anymore now; just doesn't render at all.

6/14/2013 10:21:23 AM
Gravatar
Total Posts 18439

Re: Page Not Found NullReferenceException

I've updated the article with a note about how to hide the default error message when customizing the 404 page.

For <asp:Hyperlink you would have to set your own url and text, I think what you are looking for is:

<portal:sitemaplink id="SiteMapLink1" runat="server" cssclass="sitemaplink" />

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.