1.首先创建空白页 wfmAbout.aspx 指向wfmAboutDisplay.aspx页面
----------------------------------------------------------
<iframe name="I1" align="top" hspace="0" vspace="0" src="wfmAboutDisplay.aspx" frameBorder="0" width="778" scrolling="yes" height="100%" style="WIDTH: 778px; HEIGHT: 74%">
</iframe>
2.wfmAboutDisplay.aspx这也是一个空白页,是为了转向所定义的两帧
wfmAboutLeft.aspx和wfmAboutRightDisplay.aspx
----------------------------------------------------------
<frameset cols="136,635">
<frame src="wfmAboutLeft.aspx" scrolling="no" noresize frameborder="0" name="leftone">
<frame src="wfmAboutRightDisplay.aspx frameborder="no" name="rightone"> // 用来命名触发TreeView所致向的目标
----------------------------------------------------------
<iframe name="I1" align="top" hspace="0" vspace="0" src="wfmAboutDisplay.aspx" frameBorder="0" width="778" scrolling="yes" height="100%" style="WIDTH: 778px; HEIGHT: 74%">
</iframe>
2.wfmAboutDisplay.aspx这也是一个空白页,是为了转向所定义的两帧
wfmAboutLeft.aspx和wfmAboutRightDisplay.aspx
----------------------------------------------------------
<frameset cols="136,635">
<frame src="wfmAboutLeft.aspx" scrolling="no" noresize frameborder="0" name="leftone">
<frame src="wfmAboutRightDisplay.aspx frameborder="no" name="rightone"> // 用来命名触发TreeView所致向的目标
解决方案 »
- 无限商品分类,无限商品属性的实现,跪求!!!
- 关于LosFormatter的问题,急!
- 请高手帮我检查一段代码
- xslt 问题
- 安装IIS出现的问题
- 请问怎么才能让单号重复时两个数据库都不录入
- 有关服务器端Table控件的问题:TableRow能不能加入JS代吗?
- datagrid中如何在下拉滚动条的时候固定住表头【100分】
- 我用WebClient的UploadfIle()方法时,出错如下错误?
- ASP.NET能否实现CAD图纸的预览(新任版主,思归等各位大侠请进来帮我看一下)
- *.asp 正常,*.aspx *。asmx会有乱码(能搞店,100分,)
- ASP.Net: DataGrid分页问题?
<frame id="f1" runat="server"/>
<frame id="f2" runat="server"/>
</frameset><script language="C#" runat="server">
void Page_Load (Object sender, EventArgs e)
{
fs.Attributes["cols"] = "200,*";
f1.Attributes["src"] = "http://www.csdn.net";
f2.Attributes["src"] = "http://www.microsoft.com/china";
}
</script>if you are using code-behind, declare the following in your Page class:protected HtmlGenericControl fs;
protected HtmlGenericControl f1;
protected HtmlGenericControl f2;
Response.Write(fs.GetType()+"<br>");
现在框架是可以弄好了,假如我分为左右两个框架,在左边做一个链接,想在右边的框架中显示另一个页面,可是它并不是在右边的框架中显示,而是弹出另一个窗口来显示???
请问这是怎么回事阿???
代码如下:
index.aspx :
<%@ Page language="c#" src="index.cs" Inherits="index"%>
<html>
<head>
<title>lem0nka1驿站</title>
</head>
<frameset id="mainFS" runat="server">
<frame id="topFrame" runat="server" noresize></frame>
<frameset id="subFS" runat="server">
<frame id="leftFrame" runat="server"></frame>
<frame id="mainFrame" runat="server"></frame>
</frameset>
<frame id="bottomFrame" runat="server" noresize></frame>
</frameset>
<noframes>
<body bgcolor="#FFFFFF">
</body>
</noframes>
</html>index.cs :
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;public class index : Page
{
protected HtmlGenericControl mainFS;
protected HtmlGenericControl topFrame;
protected HtmlGenericControl subFS;
protected HtmlGenericControl leftFrame;
protected HtmlGenericControl mainFrame;
protected HtmlGenericControl bottomFrame; private void Page_Load(object sender, EventArgs e)
{
mainFS.Attributes["rows"]="16%,70%,14%*";
mainFS.Attributes["cols"]="*";
mainFS.Attributes["frameborder"]="NO";
mainFS.Attributes["border"]="0";
mainFS.Attributes["framespacing"]="0"; topFrame.Attributes["scrolling"]="NO";
topFrame.Attributes["src"]="top.aspx"; subFS.Attributes["cols"]="16%,84%*";
subFS.Attributes["frameborder"]="NO";
subFS.Attributes["border"]="0";
subFS.Attributes["framespacing"]="0"; leftFrame.Attributes["scrolling"]="NO";
leftFrame.Attributes["src"]="left.aspx";
mainFrame.Attributes["src"]="main.aspx";
bottomFrame.Attributes["scrolling"]="NO";
bottomFrame.Attributes["src"]="bottom.aspx";
}
}left.aspx :
<html>
<head>
<title>leftframe</title>
<link rel="stylesheet" href="mycss.css" type="text/css">
</head>
<body>
<p align="center"><a href="main.aspx" target="mainFrame">Main</a></p>
<p align="center"><a href="article/index.aspx" target="mainFrame">Article</a></p>
<p align="center"><a href="download/index.aspx" target="mainFrame">Download</a></p>
<p align="center"><a href="myworks/index.aspx" target="mainFrame">Myworks</a></p>
<p align="center"><a href="guestbook/index.aspx" target="mainFrame">Guestbook</a></p>
<p align="center"><a href="aboutme/index.aspx" target="mainFrame">Aboutme</a></p>
<p align="center"><a href="links/index.aspx" target="mainFrame">Links</a></p>
<p align="center"><a href="cklog.aspx" target="mainFrame">Login</a></p>
</body>
</html>
<base target="mainFrame">
to your left.aspx :<html>
<head>
<title>leftframe</title>
<link rel="stylesheet" href="mycss.css" type="text/css">
</head>
<base target="mainFrame">
<body>
function document.onclick()
{
if (event.srcElement.tagName == "A")
event.srcElement.target = "mainFrame";
}
</script>
<frame id="leftFrame" name="leftFrame" runat="server"></frame>
<frame id="mainFrame" name="mainFrame" runat="server"></frame>
我是新手,还不大懂得这里的规矩^_^
你的解答让我获益不少
我还有个问题,麻烦你给回答一下
我有这样的一个框架集
|————————|————————|
| | |
| left | right |
| button1 | |
| button2 | |
| | |
——————————————————
在左框架上有两个button,单击button1,则right 框架装入一个页面
单击button2,则right框架装入另一个页面
请问该怎样实现,代码该写在那个页面里?
其中框架集所在的页面为:all.aspx
left装入的页面为:left.aspx
谢谢你了
同时,为了报答你的厚恩,我会在继续加分
var param1=1,param2=2;
function gotoLink(sURL)
{
parent.frames['PutRightFrameName'].location.href = sURL + "?param1=" + param1 +"¶m2=" + param2;
}
</script>