邪恶框架和ASP.Net [英] Evil Frames and ASP.Net
问题描述
大家好
我有2个aspx页和一个母版页.
我知道框架是邪恶的,但我使用它们将母版页中的2个aspx页组合在一起.现在,我创建了第三个aspx页面并使用了母版页面,它可以工作,但是我无法在第3个aspx表单的内容占位符中找到控件.
可能的话,请帮助!!!!
以下是我的第一个aspx页面
Hi guys
I have 2 aspx pages, and a master page.
I know frames are evil but i used them to combine the 2 aspx pages inside the master page. Now i created a 3rd aspx page and used the master page and it works but i cant find my controls inside content placeholder of my 3rd aspx form.
Help if possible!!!!
Below is my first aspx Page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ContentPage.aspx.cs" Inherits="Data_ContentPage" %>
<!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>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<!-- header -->
<div id="header">
<div id="loggo">
</div>
<!-- / header -->
<div class="cont_top"></div><!--Top round corners-->
<!-- content -->
<div id="content">
Hello there
</div>
<!-- /content -->
<div class="cont_bot"></div><!--Bottom round corners-->
</div><!--End main-->
</div><!--End Header-->
</body>
</html>
以下是我的第二个使用javascript
Below is my second aspx page with javascript
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Outlook.aspx.cs" Inherits="Data_Outlook" %>
<!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>
<script src="outlook.js" type="text/javascript"></script>
<script src="crossbrowser.js" type="text/javascript"></script>
<SCRIPT>
// ---------------------------------------------------------------------------
// Example of howto: use OutlookBar
// ---------------------------------------------------------------------------
//create OutlookBar
var o = new createOutlookBar('Bar', 0, 0, screenSize.width, screenSize.height, '#fff', 'red')//'#000099') // OutlookBar
var p
//create first panel
// p.addButton('netm.gif','Netmanage');
//window.open("index.html")
//window.location="index.html"
p = new createPanel('l2', 'Scheduling');
p.addButton('calSche.jpg', 'Add Scheduling', 'alert("Adresse")');
p.addButton('ViewSche.jpg', 'View Scheduling', 'alert("Adresse")');
o.addPanel(p);
p = new createPanel('al', 'Monitoring');
p.addButton('Doc.jpg', 'View Health Records', 'window.open("index.html")');
p.addButton('nurse.jpg', 'Add Health Status', 'alert("News")');
o.addPanel(p);
p = new createPanel('p', 'Medication');
p.addButton('mail.gif', 'Prescibe Medication', 'alert("Mail2")');
p.addButton('peditor.gif', 'Treatment Plan', 'alert("Personal Editor")');
o.addPanel(p);
p = new createPanel('l', 'Health Record');
p.addButton('news.gif', 'Adresse', 'alert("Adresse")');
p.addButton('mail.gif', 'Postausgang', 'alert("Postausgang")');
p.addButton('mail.gif', 'Posteingang', 'alert("Posteingang")');
o.addPanel(p);
p = new createPanel('l3', 'Reports');
p.addButton('news.gif', 'Adresse', 'alert("Adresse")');
p.addButton('mail.gif', 'Postausgang', 'alert("Postausgang")');
p.addButton('mail.gif', 'Posteingang', 'alert("Posteingang")');
o.addPanel(p);
o.draw(); //draw the OutlookBar
//-----------------------------------------------------------------------------
//functions to manage window resize
//-----------------------------------------------------------------------------
//resize OP5 (test screenSize every 100ms)
function resize_op5() {
if (bt.op5) {
o.showPanel(o.aktPanel);
var s = new createPageSize();
if ((screenSize.width != s.width) || (screenSize.height != s.height)) {
screenSize = new createPageSize();
//need setTimeout or resize on window-maximize will not work correct!
//benötige das setTimeout oder das Maximieren funktioniert nicht richtig
setTimeout("o.resize(0,0,screenSize.width,screenSize.height)", 100);
}
setTimeout("resize_op5()", 100);
}
}
//resize IE & NS (onResize event!)
function myOnResize() {
if (bt.ie4 || bt.ie5 || bt.ns5) {
var s = new createPageSize();
o.resize(0, 0, s.width, s.height);
}
else
if (bt.ns4) location.reload();
}
</SCRIPT>
</head>
<body onLoad="resize_op5();" onResize="myOnResize();">
</body>
</html>
以下是我的母版页
Below is my master Page
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPg.master.cs" Inherits="MasterPg" %>
<!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=iso-8859-1">
<title></title>
</head>
<frameset cols = "200,*" frameborder="yes" bordercolor="silver" border="0">
<frame SRC="Data/Outlook.aspx" name="Links" scrolling="No">
<frame SRC="Data/ContentPage.aspx" name="main" scrolling="AUTO">
</frameset>
<noframes>
<body>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</body>
</noframes>
</html>
现在,下面是我的第三个带有contentplace Holder的页面,并且当我将
Now Below is my 3rd page with contentplace Holder and whn I use the
<%@ Page Language="C#" MasterPageFile="~/MasterPg.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content1" runat="server"
contentplaceholderid="ContentPlaceHolder1">
</asp:Content>
希望这对您有帮助
Hope this helps
推荐答案
http://www.dreamincode.net/forums/topic/16442-div-vs-frames/ [
http://www.dreamincode.net/forums/topic/16442-div-vs-frames/[^]
See if this site convinces you whether divs or frames are the way you need to go....
这篇关于邪恶框架和ASP.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!