Page 1 of 1
Error Page
Posted: Mon Dec 13, 2010 6:50 pm
by sloDavid
I have a custom theme set for my store, but the original AbleCommerce theme CSS html still gets output when a site visitor lands on the 404 PageNotFound page. I.e.,
Code: Select all
<link href="../App_Themes/AbleCommerce/ComponentArt.css" type="text/css" rel="stylesheet" />
<link href="../App_Themes/AbleCommerce/print.css" type="text/css" rel="stylesheet" />
<link href="../App_Themes/AbleCommerce/style.css" type="text/css" rel="stylesheet" />
<link href="../App_Themes/AbleCommerce/webparts.css" type="text/css" rel="stylesheet" />
Is there a way to nix that HTML? Or at least get it to output the proper theme instead of "AbleCommerce"? I have a custom public theme, but am still using AbleCommerce for the Admin area.
Re: Error Page
Posted: Mon Dec 13, 2010 9:29 pm
by dappy2
Is there a way to nix that HTML? Or at least get it to output the proper theme instead of "AbleCommerce"? I have a custom public theme, but am still using AbleCommerce for the Admin area.
I built a design for the 404 error page on my site and it works fine and loads the proper HTML/CSS from my theme*:
http://www.drugtestcentral.com/Errors/PageNotFound.aspx
I'm pretty sure this is what I did:
1. Make a backup of the /Errors/ directory
2. Duplicate (copy & paste) the webpage.aspx file in the site root
3. Rename it PageNotFound.aspx
4. Place it in the Errors folder and overwrite the default PageNotFound.aspx.
5.
I'm not sure if you will need to add anything back in the code behind in order to log errors
The PageNotFound.aspx page should act like other pages - meaning if you are logged in as admin, you should have the Drop Down for view/edit. I created a 404 content html file and put some controls on there for the search box, everything else is my normal header/nav/footer etc.
It makes sense to build a custom 404 page because there isn't an application error, your AbleCommerce controls should still work and you can place things like the search control on there to help people out.
Dappy
* There's an error currently on my site where if there is a query string on the URL the error page doesn't load. IIS serves the default IIS 404 page. This IIS issue is being resolved for my store. Query strings work perfectly on my testing server and even populate the search box.
Re: Error Page
Posted: Thu Dec 16, 2010 6:59 pm
by sloDavid
Dappy,
I think you did something else. I can see the appeal of what you did, however. I like the idea of all the data-driven nav stuff still being there.
For other people who try this, however, simply replacing PageNotFound with the Webpage file induces a redirect loop. Webpage.aspx relies on the WebpageId, which a visitor to PageNotFound doesn't generate. When that WebpageId is missing, the page auto-redirects to PageNotFound... which the user is already on. So you need to adjust the Page_Init code, create a hidden webpage and use that for the WebpageId.
Trying your technique led me to the simple answer to my question, though. The problem is that PageNotFound inherits from System.Web.UI.Page, instead of CommerceBuilder.Web.UI.AbleCommercePage. Since it's just running default code, it uses the theme specified in the web.config, which had not been updated to my custom theme, but instead was still set as "AbleCommerce". (system.web : pages @theme)
Changing the theme attribute fixed my problem.