Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...asp server side scriptingasp server side scripting
Previous
 
Next
New Post
2/7/2014 8:58 AM
 

I am very new to asp and do not yet know how it works.

I am trying to create a side menu which always shows the 3rd level (only children menu items of current 2nd level or menu items with same parent if current level is 3). To do this i am using the attribute "NodeSelector"

this works

<dnn:SUBMENU runat="server" id="dnnSUBMENU" MenuStyle="SuperFishCustom" NodeSelector="0,0,1"/>

but the {root} value should be 1 - n (not 0) where n is the current level

this doesnt work 

<dnn:SUBMENU runat="server" id="dnnSUBMENU" MenuStyle="SuperFishCustom" NodeSelector="<% 1 - PortalSettings.ActiveTab.Level %>,0,1"/>

Can someone tell me what i am doing wrong and maybe how to get it to work the way i want.

Thanks

 
New Post
2/7/2014 9:49 AM
 
AFAIR submenu is from solpart which has been deprecated for some time (it's only shipped to support very old sites) - I'd recommend looking into ddrmenu http://www.dnnsoftware.com/wiki/page/... . Note:above you cannot use inline script i.e. <% %> as the control is a server control -inline scripting works within the rendered output such is more appropriate for occasional use in html/javascript.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/7/2014 10:37 AM
 

FYI i am using ddrmenu.

OK, so this raises the next question how do i add server side script to a server side control?

 
New Post
2/7/2014 1:54 PM
 

you don't add server side script as it isn't processed as part of a server control declaration - you can do it declaratively in the property if you know the value in advance. If you don't then you do it programmatically in the codebehind e.g. in the ascx.cs e.g something like:

 dnnSUBMENU.NodeSelector=  PortalSettings.ActiveTab.Level-1.ToString() + ",0,1";

Another (lesser used) option is to use an inline script that is hooked up to the page events e.g. in the ascx have:

<dnn:SUBMENU runat="server" id="dnnSUBMENU" MenuStyle="SuperFishCustom"/>

<script runat="server">

  public void Page_Load(object sender, EventArgs e)

{

  dnnSUBMENU.NodeSelector=  PortalSettings.ActiveTab.Level-1.ToString() + ",0,1";

}                    

</script>

Note: I haven't tested if these compile, but they should work or at least get you very close.


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
10/20/2014 9:49 AM
 

Hi,

I would also like to use the feature to set the NodeSelector in the code behind. But it doesn't compile.

<%@ Register TagPrefix="dnn" TagName="MENU" Src="~/DesktopModules/DDRMenu/Menu.ascx" %>

...

<dnn:MENU ID="MenuProfile" MenuStyle="MenuProfile" IncludeHidden="true" runat="server" ></dnn:MENU> 

In Page_Load I try:

protected void Page_Load(object sender, EventArgs e) {
    var profileNode = Config.Instance.Navigation.ProfileNode; // set node in web.config
    MenuProfile.NodeSelector = profileNode + ",0,1";
}

But NodeSelector is not in System.Web.UI.UserControl. What do I have to do to fix this?

Kind regards

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...asp server side scriptingasp server side scripting


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out