HTML:

<!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>
<body>
    <form id="form1" runat="server">
    <asp:Button  ID="btnClick" runat="server" Text="点我" onclick="btnClick_Click"/>
    <div>
        <iframe runat="server" id="frame" src="Demo1.aspx">
            
        </iframe>
    </div>
    </form>
</body>
</html>

后台C#代码:

    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnClick_Click(object sender, EventArgs e)
        {
            this.frame.Attributes["src"] = "Demo2.aspx";
        }
    }

 

posted on 2013-10-24 10:17  千叶景枫  阅读(1061)  评论(0编辑  收藏  举报