how can we set the resolution of a web page created in asp.net?
how to set the resolution of a web page created in asp.net?
Collapse
X
-
Actually question was also asked from me in an interview so if there is any method please suggest he give me hint if this is done by checking the properties of projectComment
-
You can't really do this in ASP.NET because ASP.NET is a server-side technology. That means that it is not aware of client side stuff like "resolution ". Therefore, you would have to some how check the resolution of the user's computer using a client-side scripting language like JavaScript to set the "resolution ".
So, you would have to set a HiddenField or Cookie with the window's resolution using JavaScript and post back to the server (you could simply do this by calling the __doPostbackMet hod). Only do this if cookie/HiddenField hasn't been set yet.
Then on the server you could retrieve this value and choose images etc according to the resolution indicated in the HiddenField or cookie.
This is a very round-about-way to do things though.
I would probably just use CSS that didn't depend on the resolution. Using things like percentages and "em" to set the height and width of things. That way I can avoid "resoultion " issues.
-FrinnyLast edited by Frinavale; Sep 8 '10, 01:07 PM.Comment
-
I would always prefer to set height/width of any control of my web page in percentage(%).. ...thats how resolution doesn't effect on the layout of your web page.....Comment
-
Comment
Comment