Search code examples
c#asp.netupdatepanel

Setting ASP.NET update panel to be 100% of its parent container?


How can I set an ASP.NET update panel to be 100% of its parent container? Right now it's height is just big enough to fit its contents. It's display mode is block. I added a

style="height: 100%"

attribute to the updatepanel tag, but the parser complained that the style tag is undefined for asp:UpdatePanel.


Solution

  • height: 100% is very bad style solution. This won't work after resizing or similar user actions.

    All you can do - set the height automatically by javascript. See also this answer (it is about the iframe, but javascript is easily updated for your needs)