本人初学Asp.net,用VS2008,以前用JSP做页面框架时,是用Frameset的,但是VS2008的Asp.net使用XHTML1.0,不支持Frameset。大家在做左右页面或者上下页面时,是怎么做的呢?

解决方案 »

  1.   

    怎么不支持。
    我这个就是一个框架页。
    三部分。top,left,right
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="HIPS.UI.Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>信息发布系统</title>
    </head>
    <frameset rows="100,*" frameborder="no" border="0" framespacing="0">
      <frame src="Head.aspx" name="topframe" scrolling="No" id="topframe" title="topframe" />
      <frameset id="mainframeset" cols="200,*" frameborder="no" border="0" framespacing="0">
            <frame src="LeftMenu.aspx" name="leftframe" noresize="noresize" id="leftframe" title="leftframe" />
            <frame src="Main.aspx" name="mainframe" id="mainframe" title="mainframe" />
      </frameset>
    </frameset>
    <noframes>
        <body>
        </body>
    </noframes>
    </html>
      

  2.   

    在Frameset和frame下面不会有警告吗?
    我这边会提示XHTML1.0 不支持Frameset
      

  3.   

    方法一: 可以用frameset,但不能切换设计
    方法二: 可以用<Table> + <iFrame>如:
    <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
            <tr>
                <td colspan="5" height="59">
                    <iframe id="frame1" runat="server" frameborder="0" height="60px" name="frame1" src="top.aspx"
                        width="100%"></iframe>
                </td>
            </tr>
            <tr>
     <td style="width: 100%">
                    <iframe id="frmContent" frameborder="0" height="100%" name="frmContent" scrolling="auto"
                        src="test.aspx" style="visibility: inherit; z-index: 1" width="100%"></iframe>
                </td>
            </tr>
    <tr>
                <td colspan="5" height="34">
                    <iframe id="frmSBot" runat="server" frameborder="0" height="34px" src="bottom.aspx"
                        width="100%"></iframe>
                </td>
            </tr>
        </table>
      

  4.   

    在Frameset和iframe
    都能用。
      

  5.   

    asp.net 中,你可以试下用master——母版页,也挺好用的。。
      

  6.   

    用模板页master

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
    </head>
        <frame src="top.aspx" name="topFrame" scrolling="no" noresize>
    <frameset id="mainFrame" cols="178,10,*" framespacing="0" frameborder="0">
    <frame src="menu.aspx" name="leftFrame" noresize>
    <frame src="left.htm" name="Left" scrolling="no" noresize>
    <frame src="Default.aspx" name="rightFrame" noresize >
    </frameset>
    </html>
      

  7.   

    看情况了。后台的那种我一般用框架,其他的如果页面大致风格一样的话就用master了
      

  8.   

    现在用iframe,可以实现左右页面,不过没有frameset那样中间有一条线
    我是用DIV来搭框架的
      

  9.   

    现在用frameset,不过呢有警告不爽
    效果倒是达到了