Request.Browser.JavaScript is Obsolete

  • Thread starter Thread starter Armand
  • Start date Start date
A

Armand

Hi everyone,
I am trying to detect the client browser wether or not it supports
javascript.
Usually we use Request.Browser.JavaScript but now it has become
obsolete in .NET 2.0
any idea?

Thanks a lot
 
Request.Browser.JavaScript hasn't been obsoleted in ASP.NET 2.0.

It works in ASP.NET 2.0.

The only thing is...that the browser may have JavaScript disabled,
so -even if the browser *can* run JavaScript, it may have been disabled.



Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Hi,

I would handle that on the client, safest and easiest way to go.

For example:

<a href="nojs.html" onclick="doSomething();return false;">Go to new page</a>

If JavaScript is on, the onclick is executed. Return false in the link
prevents the HREF part to be called. If JavaScript is off, however, the
onclick is ignored and the HREF is called. The page nojs.html offers a
non-dynamic version of the site, or an explanation as to how to enable
JavaScript, this kind of thing.

HTH
Laurent
 
That refers to : System.Web.Configuration.HttpCapabilitiesBase
which is not equivalent to : System.Web.HttpBrowserCapabilities

I use Request.Browser.JavaScript in :
http://asp.net.do/test/browserDetect.aspx and no "obsolete" message shows up.

See theClass Browser :
http://www.asp.net/QUICKSTART/util/...pace=System.Web&class=HttpBrowserCapabilities

System.Web.HttpBrowserCapabilities is very much alive
in the .Net Framework 2.0...and it *does* have a JavaScript property.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
I thought it is:
http://msdn.microsoft.com/netframew...i/ObsByAssembly.aspx#System.Web.Configuration

anyhow, I tried:

If Request.Browser.JavaScript = True Then
'...
End If

The request.browser.javascript got underlined and the error message
says "Obsolete"
 

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

Back
Top