<%@ Page Language="C#" AutoEventWireup="false" debug="true" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>CSharpTemp</title>
<meta name=vs_defaultClientScript content="JavaScript">
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
} // 在 Page_Unload 事件里把脚本添加到文件尾
private void Page_Unload(object sender, System.EventArgs e)
{
System.Web.HttpContext.Current.Response.Write("<script language='JavaScript'>alert('添加到文件尾了,请点击“查看源文件”查看!');<"+"/script>");
} override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Unload += new System.EventHandler(this.Page_Unload);
this.Load += new System.EventHandler(this.Page_Load);
}
</script> </head>
<body>
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>CSharpTemp</title>
<meta name=vs_defaultClientScript content="JavaScript">
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
} // 在 Page_Unload 事件里把脚本添加到文件尾
private void Page_Unload(object sender, System.EventArgs e)
{
System.Web.HttpContext.Current.Response.Write("<script language='JavaScript'>alert('添加到文件尾了,请点击“查看源文件”查看!');<"+"/script>");
} override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Unload += new System.EventHandler(this.Page_Unload);
this.Load += new System.EventHandler(this.Page_Load);
}
</script> </head>
<body>
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>
解决方案 »
- 年会发了一个Surface,特此散分。
- 请教一个有意思的问题。。。。。快速占用电脑资源。
- c# winform 如何往oracle的blob字段中插入图片`?
- 我想在页面关闭时,执行数据库操作.怎样用onbeforeunload,使onbeforeunload只在关闭时触发,而刷新不触发!!
- 兄弟们,求在WinForm下如何限制DataGrid的某一单元格只可输入数字最佳方法!谢谢了!
- 如何把后缀为CS文件变成后缀为DLL文件
- <在 ASP.NET 中使用 HTTPHandler 实现 Front Controller>中的HTTPHandler指的是什么?
- 用.net创建AD用户的时候,如何同时创建 Live Communications 用户,我已经安装了Live Communications 2003
- -------------------------------------怎么实现WinXP样式的按钮?
- ★★★★★datagrid绑定的时候出现错误★★★★★
- 类文件存放?
- 在Winform中,DataGrid绑定数据源,当按Delete键时会自动删除所选记录,怎样让用户按Delete时不删除掉选定行记录??
到页面的底部加一个Literal控件。
在Page_Load中
Literal1.text=脚本就行了