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

HomeHomeDevelopment and...Development and...Getting StartedGetting Startedassign a role to a visitor dynamically with ascxassign a role to a visitor dynamically with ascx
Previous
 
Next
New Post
4/14/2010 2:35 AM
 

hello everyone,

My wish is to assign with parameters included in the url the role for my visitor.

I have 3 modules for 3 different roles.

So if you visit the page with role1 you will only see module1 role2 mosule2....

My goal is to assign this role with the value posted in my URL only with code in my ASCX.

here is my actual code to get my parameters in my URL (in my aspx) :

<%
    Dim key
    Dim role
    key = Request.QueryString("key")
    role= Request.QueryString("role")
%>

tabid=20&role=role1 will only display module1.

I just want the ascx code to make DNN believe that the visitor is connected as a user of the role passed in the URL.

Hope i'm clear in my explanations.

Thank you

 
New Post
4/14/2010 2:57 PM
 

A simple way is to have the module hide the "main" content. Wrap it in a div and set the visibility to false when the role or key isn't what it's supposed to be.

<div runat="server" ID="divMain" visibility='<%= Request.QueryString("role") IS NOT NOTHING AND Request.Querystring("role") == "1" %>'
''Your content here
</div>

That is off the to pof my head, and I normally have to try something 5 or 6 times when I'm doing server variables before I get it right. :)
 

If you set the modules to have no container, then they will never know there is anything else there.

 

 

You can't have DNN actually obey roles like that since a change in the URL changes the role - Not very secure.
I'd investigate if some combination of pages and security roles could do what you are trying to do and keep the content secure for the individuals who should have access to it.
 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting Startedassign a role to a visitor dynamically with ascxassign a role to a visitor dynamically with ascx


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