处理page_load,page_error等event

longbow74 2002-07-31 04:33:22
需要设置AutoEventWireup或Page.Error += new System.EventHandler(Page_Error);这个代码应该放在哪里,怎么写?
...全文
166 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
longbow74 2002-08-01
  • 打赏
  • 举报
回复
http500:internal server error
你普通的html能正常显示么?
ketao_78 2002-07-31
  • 打赏
  • 举报
回复
帮帮忙,请问有遇到过http500错误么
现在asp,asp.net文件都不能运行,已经重装了iis,.net framework
不可能重装windows
howbigsea 2002-07-31
  • 打赏
  • 举报
回复
回答的完美
spring_ok 2002-07-31
  • 打赏
  • 举报
回复
在你的程序中加入这样一段:
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
Page.Error += new System.EventHandler(Page_Error);

}

在 aspx页面头部:
<%@ Page language="c#" Codebehind="xxx.aspx.cs" AutoEventWireup="false" Inherits="xxxx" %>

62,266

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧