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 check if a UserControl is ruuing on DNN or ASP.NET platformHow to check if a UserControl is ruuing on DNN or ASP.NET platform
Previous
 
Next
New Post
8/28/2008 10:01 PM
 

As title,

I got a UserControl that need to run on both DNN and ASP.NET. And I need a checking mechanism to distinguish where the UserControl is running. Any variable or flag (e.g., in Cookie) can be used for the purpose?

Regards,

Ricky.

 
New Post
8/29/2008 9:35 AM
 

Guessing the UserControl itself isn't dependent on any DNN assemblies in order to run, since you'll be popping it into a couple different areas?  If it isn't, you might be able to use reflection to get the path to the bin folder, then check the bin folder for the existence of the DotNetNuke.dll file.  Less drastic (and costly), you might be able to check the web.config of the hosting application for something that is DNN specific such as the sectiongroup for DotNetNuke.  Or check the root app folder for "DotNetNuke.config".

Probably a multitude of other ways you could check, but I'm sure one of the above would suit your needs.


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
8/31/2008 10:41 PM
 

As was mentioned, there are a multitude of ways to check if the control is running in a DNN installation. One of the simplest and least costly would be to check (after the user control has been added to the Controls collection of the parent) the control's ClientID property to see if it contains (starts with) the prefix "dnn_". This should be reliable unless the framework has been modified to remove this trace of a DNN site.


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 check if a UserControl is ruuing on DNN or ASP.NET platformHow to check if a UserControl is ruuing on DNN or ASP.NET platform


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