sitemenu render problems

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/14/2009 8:48:21 PM
Gravatar
Total Posts 29

sitemenu render problems

I am having a strange problem and I'm not having much trouble with it. On my dev box the sitmenu (son of System.Web.UI.WebControls.Menu) renders just fine. When I post the web site to the production box, the menu wont render at all - just text/hyperlinks.

 

Here is the (wrong) html generated on the production box:

-snip-

<table id="ctl01_SiteMenu1_ctl00" class="ctl01_SiteMenu1_ctl00_2" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td id="ctl01_SiteMenu1_ctl00n0" title="Home" onkeyup="Menu_Key(event)" onmouseout="Menu_Unhover(this)" onmouseover="Menu_HoverStatic(this)">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="white-space: nowrap;">
<a class="ctl01_SiteMenu1_ctl00_1" href="home.aspx">Home</a>
</td>
</tr>
</tbody>
</table>
-snip-

and here is the exact same code rendered on my dev box:

<div id="ctl01_SiteMenu1_ctl00" class="AspNet-Menu-Horizontal">
<ul class="AspNet-Menu">
<li class="AspNet-Menu-Leaf AspNet-Menu-SelectedLeaf">
<a class="AspNet-Menu AspNet-Menu-SelectedLeaf" title="Home" href="/home.aspx"> Home</a>
</li>
<li class="AspNet-Menu-Leaf">
<a class="AspNet-Menu" title="Pack 306 Calendar" href="/pack-306-calendar.aspx"> Pack 306 Calendar</a>
</li>
<li class="AspNet-Menu-Leaf">
<a class="AspNet-Menu" title="Dens" href="/1dens.aspx"> Dens</a>
</li>
<li class="AspNet-Menu-Leaf">
<a class="AspNet-Menu" title="Files" href="/files.aspx"> Files</a>
</li>
<li class="AspNet-Menu-Leaf">
<a class="AspNet-Menu" title="Pack Administration" href="/pack-administration.aspx"> Pack Administration</a>
</li>
</ul>
</div>
 

I have checked the production box (iis6) and it appears to have all the latest .net patches. I even pointed my dev site to use the production database to try and recreate it...

Any ideas?

Thanks

Greg P

1/15/2009 4:57:50 AM
Gravatar
Total Posts 18439

Re: sitemenu render problems

Hi Greg,

The first rendering is the normal behavior of the ASP.NET menu, it generates tables which are not sematically ideal for menus. It was a long standing complaint that MS later resolved by putting out the CSS Control adapters which could alter the rendering to be more semantically correct. The second rendering with ul and li elements is using the Control Adapter.

In mojoPortal Menus we use the Control Adapter version, but in order to make it possible for developers to also use the original menu rendering (in case they need it in their custom features), we did not extend the normal ASP.NET menu with the control adapter. Instead we created a sub class mojoMenu that inherits from ASP.NET Menu but uses the Control Adapter. So to get the nice rendering you need to inherit from mojoMenu, not ASP.NET Menu.

The mechanisim that hooks up the adapter to the mojoMenu is is the App_Browsers/CSSFriendly.browser file. I would look in that file with a text editor and see if there are differences between production and dev. Note however, that though this file is just xml, changes made to that file wll only take effect upon a re-compile of the solution.

Hope it helps,

Joe

1/15/2009 11:36:38 AM
Gravatar
Total Posts 29

Re: sitemenu render problems

That was the clue I needed. When I noticed the *.browser file name I knew what the story was - I use unleashit and I neglected to add the *.browser file pattern to include..... So none of the *.browser files were getting copied up to the production server. Problem solved.

 

Thanks

Greg

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