Screen Resolution

M

MWulfe

I'm relatively new to ASP.Net, using VB. I want to paint the client
screen based on its resolution. What is the simplest way I can return
that value (screen width) from a Javascript function?
 
M

MWulfe

Thanks for the response.

I did not find the page you referred me to as very helpfu (it seems
extreme to have to add an entire new file to my project just to get
theclient's screen resolution!).

I would rather use the javascript screen.width (which I do know
about), but I cannot figure out how to use it in a script so I can
pick up the value from within VB.

Can you help me out with that?

Thanks.
 
G

Guest

I would rather use the javascript screen.width (which I do know
about), but I cannot figure out how to use it in a script so I can
pick up the value from within VB.

The problem is that to get a value from the javascript screen.width
you need to do a postback. And that's what the new page is supposed to
do there. For example, you can use a session variable e.g.
Session("width") to check if it's null -> do redirect to a new page ->
assign Session("width") do the rest.

Generally speaking, the easiest way to size an element relative to the
client screen is to give it a width specified as a percentage. Using
absolute sizing could be a problem when browser is resized or user
changed the default text size.
 
M

MWulfe

Thanks for your response. It got me to thinking about other ways to solve
my problem, and I have, without the screen resolution. I appreciate your
help!


I would rather use the javascript screen.width (which I do know
about), but I cannot figure out how to use it in a script so I can
pick up the value from within VB.

The problem is that to get a value from the javascript screen.width
you need to do a postback. And that's what the new page is supposed to
do there. For example, you can use a session variable e.g.
Session("width") to check if it's null -> do redirect to a new page ->
assign Session("width") do the rest.

Generally speaking, the easiest way to size an element relative to the
client screen is to give it a width specified as a percentage. Using
absolute sizing could be a problem when browser is resized or user
changed the default text size.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top