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.0Javascript DisabledJavascript Disabled
Previous
 
Next
New Post
6/27/2007 5:28 PM
 

We are developing some modules for a website we are creating using DNN.  We would like the modules to be able to handle when the user has javascript disabled in their browser.  I had hoped to find a property in the Request object that would tell me if javascript is disabled so that I could manipulate the module accordingly, but can't find any such property.   Does anyone have any recommendations/best practices for handling this condition in DNN?

Thanks
Patrick

 
New Post
6/28/2007 9:21 AM
 

I don't believe there is any property.  Most of ASP.NET will not work without javascript as most of it uses the _doPostBack method to allow the server-side event handlers to be hooked up.  The only way I know is to have a user go to a page with javascript on it that does something like a postback/callback and store that it worked in some sort of state (session/cookie, etc.).


 
New Post
6/28/2007 10:33 AM
 

I was afraid of that.  I was just hoping there was something that I had missed.

 
New Post
6/28/2007 4:11 PM
 

The root of the problem I have with running DNN with Javascript disabled is that my website is pretty much unusable, but the user has no visual indicator of why this is the case.  So, sense I can not place a message accros the whole page I have instead modified my modules to check for Javascript.  I accomplished this by defaulting the modules to an error state, then running javascript that initializes the runnable state when javascript is enabled.  Here is a small sample that i hope helps anyone else that finds themselves in a similar situation.

ascx file:
<div id="noScript" runat="server" style="display: block; color:Red">
    <asp:Label ID="lblNoScript" runat=server Text="Javascript Required"></asp:Label
>
</div>
<div id="content" runat="server" style
="display: none">
    <!-- place content here -->
</div>

cs file from Page_Load:
string script = string.Format("InitJScriptDependentItem('{0}', '{1}');", noScript.ClientID, content.ClientID);
string scriptKey = string.Format("{0}ScriptTest", this.ClientID);
Page.ClientScript.RegisterStartupScript(Page.GetType(), scriptKey, script,

js file:
function InitJScriptDependentItem(noScriptDivId, contentDivId)
{
    var noScriptDiv = document.getElementById(noScriptDivId);
    noScriptDiv.style.display = "none";

    var
contentDiv = document.getElementById(contentDivId);
    contentDiv.style.display = "block";
}

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Javascript DisabledJavascript Disabled


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