How to add Duplicate Token
Last Post 09/07/2010 7:25 AM by Lee Sykes. 4 Replies.
Author Messages
programmerboy
Nuker
Nuker
Posts:13


--
09/03/2010 11:40 AM  
How do you add a same token twice? I tried the following <%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/user.ascx" %> <%@ Register TagPrefix="dnn2" TagName="USER2" Src="~/Admin/Skins/user.ascx" %> <dnn2:USER2 CssClass="loginLinks" runat="server" ID="dnnUser2" URL="" Text="Subcribe for email alerts" /> But that is not working. When I am clicking on the dnnUser2 link, it is opening a new window that is completely blank and javascript in the URL. I have the full code like this (if it helps) <% If DotNetNuke.Security.PortalSecurity.IsInRole("Registered Users") = False Then%> <dnn2:USER2 CssClass="loginLinks" runat="server" ID="dnnUser2" URL="" Text="Subcribe for email alerts" /> <% End If%>
Joseph Craig
DNN MVP
Posts:11667


--
09/03/2010 7:06 PM  
You only need to register the control once. Then you can specify it many times. If you are familiar with ASP.NET controls it's just like having many text boxes on a page.

So, remove the second register. I'm surprised that this did not generate an error.

Joe Craig, Patapsco Research Group
Complete DNN Support
programmerboy
Nuker
Nuker
Posts:13


--
09/03/2010 7:35 PM  
Posted By Joseph Craig on 03 Sep 2010 7:06 PM
You only need to register the control once. Then you can specify it many times. If you are familiar with ASP.NET controls it's just like having many text boxes on a page.

So, remove the second register. I'm surprised that this did not generate an error.


It was not working thats why I registered it 2nd time but no luck as well. Ok, to make things simple, how can I use same token multiple times? I remember there was a tutorial where Lee used the same token (most probably for menu) couple of times.
Joseph Craig
DNN MVP
Posts:11667


--
09/03/2010 8:05 PM  
You can do something like this:

< dnn:SOLPARTMENU runat="server" id="dnnSOLPARTMENU1" / >

 ...


< dnn:SOLPARTMENU runat="server" id="dnnSOLPARTMENU2" / >


You'll note that I put in some spaced to that this will post.  Also, I left out a lot of the "normal" attributes.

Joe Craig, Patapsco Research Group
Complete DNN Support
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
09/07/2010 7:25 AM  
A tip to remember:

In any HTML you can only have one id on a page, but you can have many instances of the same class on a page.
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile


---