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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.