473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

get browser window size in code behind

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.
--
Just another lost developer.....
Jan 19 '07 #1
3 12189
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)

**** KiteOregon **** wrote:
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.

Jan 19 '07 #2
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?

--
Just another lost developer.....
"bruce barker" wrote:
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)

**** KiteOregon **** wrote:
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.
Jan 19 '07 #3
To do a postback with javascript one of the ways is:

__doPostBack('lnkbtn1','');

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


**** KiteOregon **** wrote:
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?

--
Just another lost developer.....
"bruce barker" wrote:
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)

**** KiteOregon **** wrote:
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.
>
>
Jan 19 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: bayram guzer | last post by:
hi everybody, i have very strange error. i can not see some of the asp pages on my browser. when i look from view source, all the source is there but browser does not show anything, just an empty...
8
by: Andrew Crook | last post by:
I placed the following code in my html file window.resizeTo(1000,700) window.moveTo((screen.availWidth/2)-(1000/2),(availHeight/2)-(700/2)); The resize seems to work fine, however, the move...
12
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
1
by: chazmanian | last post by:
We have a situation where we display PDF files through IE via a method in our code-behind as follows protected void displayPDF(string exePath, string filePath { // exePath is the...
6
by: shil | last post by:
I have a server side button that needs to do some preperation and afterwards, if everything goes well, open a new browser with a specific url. I know how to execute javascript from a server side...
2
by: Rob R. Ainscough | last post by:
In my code behind (VB.NET 2.0), I've been using Response.Redirect("mypage.aspx") to navigate from one page to the next. What I'd like to do now is load a new browser window and load it with the...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I find the size of a browser window?...
15
RedSon
by: RedSon | last post by:
Yea! Now after years of applications work I have finally bit the bullet and gotten myself a website playground. But I am running into a problem. I want to be able to make some money off this site...
1
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.