本文介绍了文件背后代码中的ASP.NET按钮单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<script runat="server">

    protected void btnLogin_Click(object sender, ImageClickEventArgs e)
    {

    }
</script>



当我双击按钮时,btnLogin_Click事件将在aspx页面中生成.
我需要在aspx.cs文件中.



When I double-click on button, btnLogin_Click event is genrated in aspx page.
I want it in aspx.cs file.

推荐答案

<configuration>
    <system.web>
        <pages autoEventWireup="false"

         />
    </system.web>
</configuration>



对于单个.aspx文件:



For Individual .aspx files:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" AutoEventWireup="false" Inherits="_Default" %>



希望以上信息对您有所帮助.如果您还有其他问题,请告诉我.



I hope the above information will be helpful. If you have more concerns, please let me know.



这篇关于文件背后代码中的ASP.NET按钮单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 12:50