Hello Friends,
I am using .net 2005. In that i have master page and content page, i am using panel inside content.
Is any body know how to set panel width as per screen size at run time ??
Thanks
Hello Friends,
I am using .net 2005. In that i have master page and content page, i am using panel inside content.
Is any body know how to set panel width as per screen size at run time ??
Thanks
Add a javascript function on onload event on the body tag to resize your panel width.
Note, this code has been typed without syntax verification.
<script language="javascript" type="text/javascript">
function Resize(item, width)
{
document.getElementById(item).width = width;
}
</script>
<body onload="Resize(<%= Mypanel.ClientID %>, screen.width)">
Set a css class attribute on your panel
<asp:Panel CssClass="fullWidth" ID="MyPanel" runat="server">
</asp:Panel>
Then link to an external css stylesheet from your master page an in that set the following
.fullWidth
{
width: 100%;
}
NOTE: This sets the width of any element with class fullWidth to 100% of the width of it's parent and can be used for other elements also