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.0How to programmatically set visibility of Modules?How to programmatically set visibility of Modules?
Previous
 
Next
New Post
12/11/2009 4:19 AM
 

I am planning to create one module to display annoucement for user of web site.

While the announcement module must be keep showing and then it is also can be programmatically set the visibility of the other module on that page.

For example, users from United Kingdom, United States, and Canada can be only read the announcement and the content of that page which is including other modules (can be more than 2 modules at that page, right?)

At the other hand, visitors who are not from 3 countries mentioned above will only able to read the announcement module, but cannot read other content of that page like other modules must be invisible.

Anyone know how to control or setting the other modules to be visibility?

 
New Post
12/11/2009 9:05 AM
 

 hexa how

Probably your task is defined unproperly. Think you have to make one module:

1) This module should take an IP of the visitor and get country of this IP. Be sure some percent of IPs do not relate to any country. Code to get country by IP you can get from the core (module of the Users registration).

2) You should to know what country relates what announcements and show ONLY announcements for current user based on country from step #1. You do not need to show all announcements.

BTW: may be you can use some existing modules for Localization. They show content based on selected language. it is not exactly what do you need, only thoughts.

Really, displaying several modules and hide some of them from time-to-time is not good idea ;)

Sergey

 
New Post
12/13/2009 8:11 PM
 
Thanks Sergey Velichko, Do you mean that I can not programmatically let other modules to be visibility from my module? And, are you suggesting me to create the announcement dynamically based on detected IP address from the web visitor? For example, users from UK I will showing "UK is nice place". While users from US, I will showing "US is fantastic location"? Regards, HexaHow
 
New Post
12/14/2009 6:07 AM
 

It would be better if u Control the visiblity of modules individually i.e By default hide all the Modules and Display them on the Basis of certain condition individually.

To Hide/Show the Modules on the Page Use

PortalModuleBase.ContainerControl Property .Follow this Link: http://kemmis.info/blog/archive/2008/06/08/programmatically-change-the-visibility-of-a-dotnetnuke-module.aspx

Hope it helps

Amrish


Amrish Sharma, MCP
 
New Post
12/14/2009 8:03 AM
 

If you are selecting what content to display based on a registered user's profile property Country, my ContentDejour module may be of assistance. Although its primary use is to show different content based on the current day, date or time, it may also be used to display different content based on a user's profile property. Default content may be displayed to unauthenticated users or those who do not have their particular profile property set.

The free module is available in the DNN Forge at http://www.codeplex.com/contentdejour


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to programmatically set visibility of Modules?How to programmatically set visibility of Modules?


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