0

I was trying to recreate a website which for now uses iframe without the iframe. But one of the main advantage of using the iframe is we have a fixed header and scrollable rest of the page and it remains like that for any screen size.

Now I am trying to recreate it using master page and the content page nested inside a scrollbale panel. It works only if I specify fixed height. So when the screen resolution is changed or someone minimizes the website window it doesn't look as good as the site with iframe. My master page is like this:

<body>
<form id="form1" runat="server">
<div>
 <table width=100%><tr><td>Test</td></tr><tr><td>Test</td></tr><tr><td>Test</td></tr><tr><td>Test</td></tr>
  <asp:Panel ID="panel1" runat="server"  height="100" Width="100%" ScrollBars="Auto">
    <asp:ContentPlaceHolder ID="main" runat="server">              
    </asp:ContentPlaceHolder>  
  </asp:Panel>
</td></tr></table>             
</div>
</form>

My page load inside the content page is like this

 protected void Page_Load(object sender, EventArgs e)
    {
        for (int rowNum = 0; rowNum < 151; rowNum++)
        {

                TableRow tempRow = new TableRow();
                for (int cellNum = 0; cellNum < 11; cellNum++)
                {
                    TableCell tempCell = new TableCell();
                    tempCell.Text =
                        String.Format("({0}, {1})", rowNum, cellNum);
                    tempRow.Cells.Add(tempCell);
                }
                Table1.Rows.Add(tempRow);

        }
    }

It works fine for maximized screen but if i minimize my screen i see two scroll bars. I want to see just one scroll bar for any screen resolution/size. How do i achieve that. Any inputs will be appreciated.

Thanks

4

0 回答 0