Scripting disabled

M

Mantorok

Is there any way, from ASP, ASP.Net or client-side scripting, to determine
whether the browser has client-scripting disabled?

Thanks
Kev
 
V

Vadivel Kumar

Mantorok said:
Is there any way, from ASP, ASP.Net or client-side scripting, to determine
whether the browser has client-scripting disabled?

Thanks
Kev

Check the below pasted MSDN code excerpt for finding whether browser
supports JS or not

using System;
using System.Web.UI;
using System.Web.UI.Adapters;

public class CustomControlAdapter : ControlAdapter
{
protected override void Render( HtmlTextWriter writer )
{
// Access Browser details through the Browser property.
Version jScriptVersion = Browser.JScriptVersion;

// Test if the browser supports Javascript.
if (jScriptVersion != null)
{
// Render JavaScript-aware markup.
}
else
{
// Render scriptless markup.
}
}
}

There is one more way to do this, check this article
(http://www.15seconds.com/issue/030303.htm) which works in .NET 1.1 as well.

Let me know if you need any further clarifications.

-
Vadivel Kumar
http://vadivelk.net
 
V

Vadivel Kumar

Mantorok said:
Thanks very much - any way of doing it in classic-asp? Just out of interest.

Kev

I think, it is possible thru make a server-call inside <NOSCRIPT> tag
as similar like below,

<NOSCRIPT>
<%
// Make a server call and log that client doesn't have JS support
%>
<NOSCRIPT>

I am not sure about this way, since I've not tested. This is just a thought.

-
Vadivel Kumar
http://vadivelk.net
 
S

sthani1981

Well,

I think there is a solution.
Just view the source of the file generated from asp.net for the below
code.
U can see the javascript generated.U can use that to find whether the
script is enabled or not

Cheers,

Thanigai
 
M

Mantorok

Well,

I think there is a solution.
Just view the source of the file generated from asp.net for the below
code.
U can see the javascript generated.U can use that to find whether the
script is enabled or not

But if scripting is disabled at the browser-end then that script will never
get executed, surely ;-)

Kev
 
P

Patrice

This is likely the idea : do something client side using scripting. If you
see server side it has been done then scripting is enabled...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top