Blog Reader RSS LoveCherry 技术无极限 GEO MVP MS Project开源技术

User Control && MasterPage

1.user control and masterpage  
2.Scrollbars for ContentPlace Holder
ASK:
Hi All,
 My problem is that I cannot work out how to make the masterpage Content Section's 'contentplaceholder' scrollable.  In addition to this if I change the screen resolution or view in different browers everything gets stretched and/or misaligned.
Basically I want the left ad panels, banner and footer sections to remain static across the whole website and only the content section to change as each new page is loaded into it. However, if the content page has a lot of text/images etc I want that section to be scrollable, and only scrollable where there is an overflow on the content sections height. At the moment the content panel grows and pushes my footer off the bottom of the page.
I am calling this page using a javascript (window.open()) method with scrollbars=no. Because i don't want any scrollbars to entire page. I need scrollbars only to the ContentPlaceholder.
I used the DIV tag but it is also not working. Please help me in this regard.
Best answer:

Hi sivavenugopal,

AFAIK there is no way to add scrollbars to the contentplaceholder. But maybe it helps to put the comtentplaceholder inside a div. The div must reside in the masterpage. Give the div style a fixed width an hight. Add the overflow scrollbar attribute to divs vertical axis. Now it should works as expected.

Here is an example the works as expected on my machine.

the master page

 

<div id="MainContent" runat="server" class="MainContent">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>

 and the css class

.MainContent
{
position: relative;
top: 0px;
left: 0px;
width: 100%;
overflow: auto;
cursor: default;
}

 Hope that could help you



posted @ 2008-04-11 21:44  大宋提刑官  阅读(272)  评论(0)    收藏  举报