Learn More





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, ...Inject ActiveTab name - Conditional Statements in C#Inject ActiveTab name - Conditional Statements in C#
New Post
7/8/2015 3:11 PM

Hi All,

I recently changed the language at the top of my ascx skin files from vb to C# and need a little help.  I used to be able to conditionally inject either the current tab name or the root parent tab name by using the following statement:

<% If PortalSettings.ActiveTab.Level > 0 Then%>
<%=PortalSettings.ActiveTab.BreadCrumbs(0).TabName %>
<% Else%>
<%=PortalSettings.ActiveTab.TabName %>
<% End If%>

This does not appear to work with C#.  I have searched fairly extensively and cannot find a resource to help.  Does anyone know the equivalent expression in C#?

Many thanks for your help!


New Post
7/8/2015 3:39 PM
why don't you stick with VB? there is no Advantage by switching to C#

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group   European Network of DotNetNuke Professionals

Speed up your DNN Websites with TurboDNN
New Post
7/8/2015 3:46 PM

If you really want to do this you need to learn C#. It will take forever if you try to do it by asking for help with every statement.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
New Post
7/8/2015 4:19 PM

Hi Sebastian! 

Thanks for taking time to answer.  I switched to C# to solve another question I had:

If there is another way to configure a DDR menu to show children if a page has children, otherwise show siblings, I can go back to VB.  I can use separate skins to accomplish this, but prefer to use conditional logic to keep the number of skins to an absolute minimum so as to not confuse clients.


New Post
7/8/2015 4:29 PM

Hi Richard!

Thanks for taking the time to respond.  I won't be asking for help with every statement - just needed help with this one item.  I switched to C# for this project only to implement a user recommended solution to a menu problem I was having:

Based on this post:, I assumed it was just a subtle syntax difference that was causing the error with my conditional statement and hoped for an easy assist.  Perhaps that is not the case and I am better creating multiple skins.  Just trying to look out for my non-technical client site administrators by keeping skins to a minimum.



HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Inject ActiveTab name - Conditional Statements in C#Inject ActiveTab name - Conditional Statements in C#

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.
Try Evoq
For Free
Start Free Trial
a Demo
See Evoq Live
Need More Information?