tags:

views:

4833

answers:

4

Hello

I am developing a web application which has Chart Controls. I have developed a common chart User Control to use across the application.

I am looking for an elegent way to set the Chart control's along with other control's width, height based on the screen(browser size).

Please help me Thanks Shaik

+1  A: 

Generally speaking, the easiest way to size an element relative to the client screen is to give it a width specified as a percentage (e.g. 25%). You can also size an object relative to the font size by specifying the width in terms of ems (e.g. 10em).

If percentages won't work, then the alternative is to use JavaScript to resize the object dynamically in the client's browser. The downside to this is that JavaScript has to interact with the HTML elements that make up the control, rather than acting on the control directly.

AaronSieb
+1  A: 
Mufasa
Thanks for the answer, and sorry for later reaply. Infact I did the same thing you said
Shaik Phakeer
A: 

A product from Cyscape called "Browserhawk" http://www.cyscape.com/showbrow.aspx will provide you with the information you need to make the correct rendering decisions on the server side.

Kyle B.
A: 

a hidden div set to 100% by 100% can be used to tell you the browser window client area size; i don't think there is a way to measure the screen without a postback/callback

see How to implement a web page that scales when the browser window is resized for additional info

Steven A. Lowe