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...Building ExtensionsBuilding ExtensionsModulesModulesHow to develop Module that renders controls depending upon Browser/PlatformHow to develop Module that renders controls depending upon Browser/Platform
Previous
 
Next
New Post
3/1/2010 10:14 AM
 

I would like to develop an application which will render different content/controls depending upon the platform/browser. For example I would like to detect which platform the User is using this moment, if he is using Desktop I would render regual size large content/control OR if the User is using Mobile ( A browser let say Safari on iPhone ) I would send small sized screen/content/control.

How do I detect the User Platform ?

How do I do above ?

 

 
New Post
3/1/2010 1:39 PM
 

 The best way is to do this via CSS.  Have a mobile.css that renders the page different if a user is visiting from mobile application.  You can control the l&f from each control via CSS as well.  So rather then having a new control for each browser, have a single control look different depending on the browser.


Nick Christy Director of Technology, r2Integrated
 
New Post
3/1/2010 5:15 PM
 

 Right, but how to detect, which Browser/Platform the User is using ?

 
New Post
3/1/2010 8:39 PM
 
You can use Javasript within your skin to detect the browser. Something like.. if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4)) { document.write(""); } Just continue the elseif for each browser you want to support. You can also do some browser detection within CSS itself. This is usefull if the difference is only a couple lines within the CSS. It also becomes more hackish code when you try to do it within the CSS, because each browser has a different level of understanding for how to read CSS. My suggestion would be to stick with the JS browser detection. There are some new libraries within various JS frameworks that make it cleaner then the IF statement. For an example using jquery read this.. http://www.tvidesign.co.uk/blog/CSS-Browser-detection-using-jQuery-instead-of-hacks.aspx

Nick Christy Director of Technology, r2Integrated
 
New Post
3/1/2010 11:14 PM
 

 Thanks Nick, this will surely help.

However, my problem is a bit different. I want to detect PLATFORM not only BROWSER, since I need to send resized screen size. I.e for Safari on Mac Desktop, it would be full screen, but Safari on iPhone it should be small screen, like that

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow to develop Module that renders controls depending upon Browser/PlatformHow to develop Module that renders controls depending upon Browser/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