Hello, I am making a web page and I want to make it 100% fluid, which means that I want to resize the images when the browser window is resized. I just need to know how to get the Panel width in px with c#. I am using master page and the panel is there; the main page that uses the master page contains the images. I tried to take the vlue of the Panel with public getter and then to call it from the main page using ((MyMasterPage)this.Master).PanelPlatformWidth, but it is returning zero (I defined the Panel's width in % in a css). What should I do?

8 Years
Discussion Span
Last Post by Freon22

I maybe wrong here but I don't think you can do that on the server side, you would have to do it on the clent side with javascript. The problem is you don't know what size the clents screen is and you don't know when they resize it or to what size they reduce it to.

But if you could do this on the server side it would require a postback and you would still need javascript to capture the event.

If I am wrong I would be happy to know how it can be done.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.