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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Coding problem in SkinCoding problem in Skin
Previous
 
Next
New Post
6/16/2008 5:55 AM
 
I'm using the following code in a skin.asxc file:
<%
Dim currentLevel = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().ActiveTab.Level
Dim currentTabID = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().ActiveTab.TabID

If currentLevel = 2 Then
%>

<div id="submenu">

<uc1:HouseMenu id='HouseMenu2' runat='server' Scope='<% currentTabID %>' ShowAdmin='True' IsRecursive='False' Orientation='H' />

</div>
<%
Else
Response.Write("Else called...")
End If
%>

Using this code im getting the following error.

An error has occurred.
DotNetNuke.Services.Exceptions.ModuleLoadException: Conversion from string "" to type 'Integer' is not valid. ---> System.InvalidCastException: Conversion from string "" to type 'Integer' is not valid. ---> System.FormatException: Input string was not in a correct format. at Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) at Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) --- End of inner exception stack trace --- at Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) at TimRolands.DNN.SkinObjects.HouseMenuSkinObject.HouseMenuSkinObject.LoadSettings() --- End of inner exception stack trace ---

Now i'm a complete ASP / DNN novice so i might be trying to do things that you aren't suposed to do :p. But basicly i want to create House Menu's based on some simple Variables like Level or hasChildren. Can anyone help me with this cause i seem to be doing something wrong and i have no idea what to try next.

Appreciate any help you can give me. Thanks.

Greetz R-J


www.rjdejong.net
 
New Post
6/17/2008 2:09 AM
 

Try to specify the datatype when you dim something.

 
New Post
6/17/2008 3:23 AM
 

I tried the following, but still got the same errors.

cStr(DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().ActiveTab.TabID)
Int(DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().ActiveTab.TabID)
Scope=' <% cStr(currentTabID) %>'
Scope=' <% Int(currentTabID) %>' 
 

I thought in ASP you don't have to declare what type of variable it's goin to be.

Thanks for the help, but still no anwser .

Greetz R-J


www.rjdejong.net
 
New Post
6/20/2008 4:37 AM
 

Anyone.


www.rjdejong.net
 
New Post
6/20/2008 5:36 AM
 

After checking that a little I'm not certain that the skin can accept code in this manner at all.

One option would be to try it recoded in this kind of form: (Please note I haven't tested this code)

 <script runat="server">

 

 Dim currentLevel as string = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().ActiveTab.Level.ToString Dim currentTabID as string = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().ActiveTab.TabID.ToString If currentLevel = 2 Then HouseMenu2.Scope = currentTabID submenu.visible = True Else submenu.visible = False

</script>

 


<div id="submenu" runat="server"> <uc1:HouseMenu id='HouseMenu2' runat='server' ShowAdmin='True' IsRecursive='False' Orientation='H' /> </div>


John Nicholson
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Coding problem in SkinCoding problem in Skin


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