Frame size

J

Just D.

How can we get the frame size or the windows size? What JAVA script should
we use to get it in C# codebehind? Is it correct that we can use the jAVA
script onload and onresize to get the current window/frame size and save
these values to the hidden controls on the page to read them from the C#
code?

Can anybody send an example of this JAVA script?

Thanks,
Just D.
 
B

Bruce Barker

window.onresize = function() {
document.getElementsByName('size')[0].value = document.body.clientHeight
+ "|" + document.body.clientWidth;
}

where size is the name of the hidden field. note the C# code will not see
the value until a postback.

-- bruce (sqlwork.com)
 
J

Just D.

Thanks Bruce,

What do you think is it a good idea to initiate a postback every time on
resize? If we add to the same script something to postback will it work
properly?

The idea was to force the IE redraw the picture on each resize to draw it
correctly.

Just D.

Bruce Barker said:
window.onresize = function() {
document.getElementsByName('size')[0].value = document.body.clientHeight
+ "|" + document.body.clientWidth;
}

where size is the name of the hidden field. note the C# code will not see
the value until a postback.

-- bruce (sqlwork.com)




Just D. said:
How can we get the frame size or the windows size? What JAVA script
should we use to get it in C# codebehind? Is it correct that we can use
the jAVA script onload and onresize to get the current window/frame size
and save these values to the hidden controls on the page to read them
from the C# code?

Can anybody send an example of this JAVA script?

Thanks,
Just D.
 
D

darrel

What do you think is it a good idea to initiate a postback every time on

Do people need to resize their browser? If so, then that'd get pretty
annoying really quick.

Can you explain what, exactly, you are attempting to do in terms of the UI?

-Darrel
 

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,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top