sure, try1.frameset.aspx:
<%@ Page language="c#" src="frameset.cs" Inherits="MyCodeBehind" %>
<frameset id="myframe" runat="server">
</frameset>2. frameset.cs:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;public class MyCodeBehind : Page
{
protected HtmlGenericControl myframe;
protected override void OnLoad( EventArgs e)
{
base.OnLoad(e);
myframe.Attributes["rows"] = "300,*";
HtmlGenericControl hgc = new HtmlGenericControl("FRAME");
hgc.Attributes["name"] ="nav";
hgc.Attributes["src"] = "http://www.csdn.net";
myframe.Controls.Add(hgc);
hgc = new HtmlGenericControl("FRAME");
hgc.Attributes["name"] ="main";
hgc.Attributes["src"] = "http://www.microsoft.com/china";
myframe.Controls.Add(hgc); }
}
<%@ Page language="c#" src="frameset.cs" Inherits="MyCodeBehind" %>
<frameset id="myframe" runat="server">
</frameset>2. frameset.cs:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;public class MyCodeBehind : Page
{
protected HtmlGenericControl myframe;
protected override void OnLoad( EventArgs e)
{
base.OnLoad(e);
myframe.Attributes["rows"] = "300,*";
HtmlGenericControl hgc = new HtmlGenericControl("FRAME");
hgc.Attributes["name"] ="nav";
hgc.Attributes["src"] = "http://www.csdn.net";
myframe.Controls.Add(hgc);
hgc = new HtmlGenericControl("FRAME");
hgc.Attributes["name"] ="main";
hgc.Attributes["src"] = "http://www.microsoft.com/china";
myframe.Controls.Add(hgc); }
}
如:
Dim MyText As New TextBox()
MyText.Text= "textbox101"
'MyText.Location = New Point(25, 25)
'我想用Location来定位此控件,但是不能实现,请问是什么原因?
Panel1.Controls.Add(MyText)