User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 392,036 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,308 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 819 | Replies: 3 | Solved
Reply
Join Date: Jan 2008
Location: India
Posts: 143
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Help argent help for getting browser name in asp without using js

  #1  
Jan 25th, 2008
hello friends...
i want to get the browser name is asp code without using js and include the css file depending upon the browser of the user.
i dont want to use js. because i am unable to include file in js.
what i did in js is ---
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if(navigator.appName =="Netscape")
{
//document.write("Mozila or Safari")
// want to include css
}
else
{
//document.write("IE")
// want to include css
}

please help.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: argent help for getting browser name in asp without using js

  #2  
Jan 25th, 2008
request.servervariables("HTTP_USER_AGENT")

this detects the current browser. Not version.
Reply With Quote  
Join Date: Jan 2008
Location: India
Posts: 143
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Re: argent help for getting browser name in asp without using js

  #3  
Jan 28th, 2008
hi
what i did is....



dim UserAgent

UserAgent = Request.ServerVariables("HTTP_USER_AGENT")
Response.Write "<p>" & UserAgent & "</p>"

if instr(1,UserAgent,"MSIE") > 0 then
Response.Write "Browser is Internet Explorer"
%>
<html><head><style type="text/css">
@import url("Home_index_IE.css");
</style></head></html>
<%
else
%>
<html><head><style type="text/css">
@import url("Home_index_NetScape.css");
</style></head></html>
<%
Response.Write "Browser is not Internet Explorer"
end if
%>
Last edited by sbv : Jan 28th, 2008 at 1:46 am.
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: argent help for getting browser name in asp without using js

  #4  
Jan 28th, 2008
well did it work?

If not, test what HTTP_USER_AGENT puts out and bind MSIE to that.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP Marketplace
Thread Tools Display Modes

Other Threads in the ASP Forum

All times are GMT -4. The time now is 11:01 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC