|
-
Jan 23rd, 2004, 08:34 PM
#1
Thread Starter
Fanatic Member
ASP & browser height
I was wondering if there is a way to determine the browser height in ASP.
I know that in Javascript there is an Screen Object, but this object cannot be accessed using ASP.
So I was wondering if there is a way to get the height and width of the users browser in ASP OR call an external JS function that has the coordinates and pass them onto the ASP section.
Last edited by invitro; Jan 23rd, 2004 at 08:40 PM.
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Jan 24th, 2004, 08:56 AM
#2
Re: ASP & browser height
Originally posted by invitro
I was wondering if there is a way to determine the browser height in ASP.
I know that in Javascript there is an Screen Object, but this object cannot be accessed using ASP.
So I was wondering if there is a way to get the height and width of the users browser in ASP OR call an external JS function that has the coordinates and pass them onto the ASP section.
ASP is server side, so it does not really have access to the browser object. You coul duse 3rd party components or use JavaScript to pass the height/width as you mentioned.
Danial
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Jan 24th, 2004, 03:47 PM
#3
Thread Starter
Fanatic Member
Yeah, I think that will work great. But, I'm not exactly sure how to do that?
You cant call a function like this:
Code:
<SCRIPT>
function test() { return someword }
</SCRIPT>
<%= test() %>
How would you go about passing in a variable?
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Jan 24th, 2004, 04:44 PM
#4
Lets say you have three pages, one which detects the height/width and pass the info to the 2nd page which stores the values in session and finally the third which performs something after retriving those value. I will use pseducode, if you need full asp code then let me know.
page 1
inc_store.asp
VB Code:
<%
dim URL
url=request.querystring("URL")
session("Height")=request.querystirng("Height")
Session("Width")=request.querystring("Width")
%>
page 2
inc_detect.asp
Code:
<html>
<body>
<script language=javascript>
var width;
var height;
width = screen.availWidth;
height = screen.availHeight;
document.location.href="inc_store.asp?Height=" + height + & "&Width=" + width
</script>
</body>
</html>
page 3
demo.asp
VB Code:
<%
if session("Width") =whatever then
do something
else
do something else
end if
%>
You could use cookie instead of session, it's up to you, you could also use iclude file in each of your asp page to see if the width/height has been set, if not then just store the current url, redirect to page1, store the value and rediret them back to the page they were visting.
Hope this helps.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|