运行时更改浏览器标题
2008-05-03 08:41
176 查看
为title加上runat="server"就可以了
<%...@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="webform._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 runat="server">
<title id="title" runat="server">Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
</div>
</form>
</body>
</html>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace webform
...{
public partial class _Default : System.Web.UI.Page
...{
protected void Page_Load(object sender, EventArgs e)
...{
}
protected void Button1_Click(object sender, EventArgs e)
...{
title.Text = TextBox1.Text;
}
}
}
<%...@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="webform._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 runat="server">
<title id="title" runat="server">Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
</div>
</form>
</body>
</html>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace webform
...{
public partial class _Default : System.Web.UI.Page
...{
protected void Page_Load(object sender, EventArgs e)
...{
}
protected void Button1_Click(object sender, EventArgs e)
...{
title.Text = TextBox1.Text;
}
}
}
相关文章推荐
- 更改tomcat运行时标题
- VC 更改标题图标、名称,检测实例运行
- ASP.NET MVC VS2010中更改默认调试浏览器
- 透过ashx看浏览器服务器运行本质(图解)
- 开源新闻速递:可以在浏览器中运行 Kali Linux 了
- JS在浏览器上的性能分析(一)脚本的下载与运行
- vue中npm run dev运行项目不能自动打开浏览器!
- java-基础入门-泛型数组列表-解决运行时动态更改数组的问题
- 在浏览器上运行Qt应用 emscripten-qt
- 让你的HTML5&CSS3网站在微软的浏览器中也能运行
- 当前用户更改运行方式出现错误的解决办法
- Tomcat发布项目时,更改浏览器地址栏图标
- Selenium打开谷歌浏览器提示chromedriver.exe停止运行且浏览器显示请关闭开发者模式
- Atitit.hybrid混合型应用 浏览器插件,控件的实现方式 浏览器运行本地程序的解决方案大的总结---提升用户体验and开发效率..
- App运行过程中需要更改System Setting(swift)
- Biztalk2009安装全过程截图,x64平台需要手动更改运行模式
- 网站运行的时候编译成功但是程序浏览器的页面不会显示怎么回事啊
- 不能以根用户身份运行 Google Chrome 浏览器
- Domino在非Windows平台运行时,关于ulimit更改