get browser window size in code behind

G

Guest

I am displaying some dynamic data in a content page, how do i figure out the
height and width of the browser in asp.net? I know i can write javascript on
the client side to get the information, but i need this information on the
server side.

thanks.
 
B

bruce barker

javascript must gather it and send it back to the server thru a postback
or ajax. you can not reliably get font sizes though. you are probably
better off, having client script resize/layout the content, otherwise
you may need to postback on a browser resize.

-- bruce (sqlwork.com)
 
G

Guest

How would i do a post back with javascirpt?

basically my contentpage is hosting a 3rd party application that is embeded
in a web page, i just need to resize that window if the browser is re-sized,
no problem if i do a post back, just not sure how?
 
B

Bharathi Kumar

To do a postback with javascript one of the ways is:

__doPostBack('lnkbtn1','');

'lnkbtn1' is a linkbutton with its size equal to 0.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top