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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPICustom Navigation Provider - Howto?Custom Navigation Provider - Howto?
Previous
 
Next
New Post
7/20/2006 7:37 AM
 
    Hi,

I am trying to develop my custom navigation provider that will be connected with a custom menu. Everything seems to be working as expected (no errors as thrown), but the menu is not changed. I have tried changing defaultProvider property in web.config to some other providers but the result was the same. Any ideas? If you have an example (I could not find) of how to make a Custom Navigation Provider step by step somewhere online would be great. Thank in advance!

Regards,
Petar
 
New Post
7/20/2006 10:02 AM
 

What skin object are you using SolpartMenu.ascx or Nav.ascx?  For custom navigation providers I suggest using Nav.ascx.  In fact, I suggest moving towards this object in all cases, as the Solpart one will eventually become obsolete.  Specifying the ProviderName in either skin object should work (in your skin.xml or as an attribute if you are using the ascx files).

While this document is not a step-by-step guide, it does cover the navigation provider fairly well.  The WebControl download page also has a sample asp.net 2.0 menu navigation provider available with source.


 
New Post
7/21/2006 6:46 AM
 
Hi Jon,

Thanks for the quick reply. I am using Nav.ascx, but I ran into some strange problems.
This line of code for example:
InitializeNavControl(Me, "SolpartNavigationProvider")
It will initisalize always the Solpart Navigation Provider and not the one that I want it to. I am sure there is something I am missing, but I cannot figure it out yet. My Navigation Provider is very simple – just overriding the properties/methods I must. My custom control is under ~/controls folder.
What I am doing then is removing all other navigation providers in the web config (including Solpart) and I get a null reference exception, because it is trying to load it, even though I do not want it to. Please let me know if I you understood my problem or even better if you have any suggestions how to clear it.
Thanks in advance.

Best Wishes,
Petar
 
New Post
7/21/2006 9:07 AM
 

The line of code you mentioned simply passes in the default providername if none is specified.  Here is the code from that method.

Protected Sub InitializeNavControl(ByVal objParent As Control, ByVal strDefaultProvider As String)

  If Len(Me.ProviderName) = 0 Then ProviderName = strDefaultProvider

 

By specifying a providername in your Skin you can override this.  The entries for the provder need to be in the web.config (for this is how the provider model works).  You will need to add your own entry to the web.config.  The name that you choose for this entry is the providername you will use in your xml or ascx file.

I strongly recommend looking at one of the 4 other providers to base your code off of. 


 
New Post
7/21/2006 10:16 AM
 
Hi Jon,

I tried that and it is still not working. Here is my code:

    <navigationControl defaultProvider="MyProvider">
      <providers>
        <clear />    
        <add name="MyProvider" type="MyProvider.Type, MyProvider.Type" />
      </providers>
    </navigationControl>

If only this part in the web config is left, my menu do not work. If I change it to this one though:

    <navigationControl defaultProvider="SolparMenuNavigationProvider">
      <providers>
        <clear />    
        <add name="SolparMenuNavigationProvider" type="MyProvider.Type, MyProvider.Type" />
      </providers>
    </navigationControl>

my menu is loaded, even though the provider name is not mine.
An exception is thrown in the first case. You can see the behavior even if you leave only the AspNavigationProvider (delete all the rest from the web.config). Changing only the defaultProvider property in web.config do not update the menu as it should.

Thanks for your help.

Regards,
Petar
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPICustom Navigation Provider - Howto?Custom Navigation Provider - Howto?


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