I’ve got a strange problem with my master pages, I’ve added a menu to a sub page called by the menu on the master page, I’ve populated the menu on this page with xml from a stored procedure I wrote. All is great until I try to fire an onmenuclick event on
the sub page menu to populate a couple of labels on the sub page, when I do that the page refreshes and I lose the master page menu? I’ve checked the css for issues in firebug, but this behaviour does not happen in Firefox just IE or Chrome. I can get you
whatever code you want.
Hi Befuddled2438,
Befuddled2438
this behaviour does not happen in Firefox just IE or Chrome
For this issue, I suggest you use F12 Developer Tools to debug your Webpages to see if there is anything breaking.
Here are some articles about F12 Developer Tools, you could refer to them.
Introduction to F12 Developer Tools:
http://msdn.microsoft.com/en-us/library/ie/gg589512(v=vs.85).aspx
How to use F12 Developer Tools to Debug your Webpages:
http://msdn.microsoft.com/en-us/library/ie/gg589507(v=vs.85).aspx
Hope they can help you.
Luther.
Use ajax update panel for the menu, it may restrict your menu to submit to the server again and will not loose the value.
Luther.Lv
Hi Befuddled2438,
Befuddled2438
this behaviour does not happen in Firefox just IE or Chrome
For this issue, I suggest you use F12 Developer Tools to debug your Webpages to see if there is anything breaking.
Here are some articles about F12 Developer Tools, you could refer to them.
Introduction to F12 Developer Tools:
http://msdn.microsoft.com/en-us/library/ie/gg589512(v=vs.85).aspx
How to use F12 Developer Tools to Debug your Webpages:
http://msdn.microsoft.com/en-us/library/ie/gg589507(v=vs.85).aspx
Hope they can help you.
Luther.
Its interesting… when I put it in debug mode and click the selected item on my menu nothing breaks, I even changed it to make it break on all exceptions; I get a few jquery issues with the library but that is the main jquery library?..
This is what I get when I surround the menu with an ajax update panel on the page:
Global Page Error
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse()
at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound,
Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type
requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext
context, String requestType, String virtualPath, String path) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Here is the code:
<table style="width:50%; overflow:hidden;"> <tr> <td draggable="auto" style="border-spacing: inherit; empty-cells: show; caption-side: top; border-collapse: separate; text-align: right;" class="auto-style12" colspan="3">
<asp:UpdatePanel ID="Panel2" runat="server"> <asp:Menu ID="mnu_catproj" runat="server" BackColor="#B5C7DE" DynamicEnableDefaultPopOutImage="False" DynamicHorizontalOffset="2" DynamicPopOutImageTextFormatString="" Font-Bold="True" Font-Italic="False" Font-Names="Verdana" Font-Size="X-Small" ForeColor="White" OnMenuItemClick="mnu_catproj_MenuItemClick" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False" StaticSubMenuIndent="10px"> <DataBindings> <asp:MenuItemBinding DataMember="Category" TextField="#InnerText" ValueField="#Value" /> <asp:MenuItemBinding DataMember="Project" TextField="#InnerText" /> </DataBindings> <DynamicHoverStyle BackColor="#CC9900" ForeColor="#0000CC" /> <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /> <DynamicMenuStyle BackColor="#B5C7DE" /> <DynamicSelectedStyle BackColor="#507CD1" /> <StaticHoverStyle BackColor="#284E98" ForeColor="White" /> <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /> <StaticSelectedStyle BackColor="#507CD1" /> <StaticItemTemplate> <%# Eval("Text") %> </StaticItemTemplate> </asp:Menu> </asp:UpdatePanel> </td>
Controls that Are Not Compatible with UpdatePanel Controls
The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported inside an
UpdatePanel control:
-
Web Parts controls. For more information, see
ASP.NET Web Parts Controls. -
FileUpload controls when they are used to upload files as part of an asynchronous postback.
-
GridView and
DetailsView controls when their EnableSortingAndPagingCallbacks property is set to
true. The default is false. -
Login,
PasswordRecovery, ChangePassword, and
CreateUserWizard controls whose contents have not been converted to editable templates. -
The Substitution control.
-
Validation controls, which includes the
BaseCompareValidator, BaseValidator,
CompareValidator,
CustomValidator, RangeValidator,
RegularExpressionValidator,
RequiredFieldValidator, and
ValidationSummary control.
curious though I solved the issue by changing the orientation of the menu from horizontal to vertical