default.cs上的ASP.NET错误

本文关键字:NET 错误 ASP 上的 cs default | 更新日期: 2023-09-27 17:58:41

我的html代码在default.aspx页面中,无法访问default.cs页面上的onclick of button事件。我正在我的default.cs页面中继承System.Web.UI.Page。有什么方法可以在.cs文件

default.cs上的ASP.NET错误

中获取onclick事件吗

确保.aspx文件包含正确的CodeBehind和Inherits:

<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="Default.cs" Inherits="Default" %>

如果在Default.cs中指定的页的类在命名空间中,请确保将其也包含在Inherits中。像这样:

<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="Default.cs" Inherits="MyNamespace.Default" %>