<legend id='xvx1a'><style id='xvx1a'><dir id='xvx1a'><q id='xvx1a'></q></dir></style></legend>

      <small id='xvx1a'></small><noframes id='xvx1a'>

        <bdo id='xvx1a'></bdo><ul id='xvx1a'></ul>

        <tfoot id='xvx1a'></tfoot>
        <i id='xvx1a'><tr id='xvx1a'><dt id='xvx1a'><q id='xvx1a'><span id='xvx1a'><b id='xvx1a'><form id='xvx1a'><ins id='xvx1a'></ins><ul id='xvx1a'></ul><sub id='xvx1a'></sub></form><legend id='xvx1a'></legend><bdo id='xvx1a'><pre id='xvx1a'><center id='xvx1a'></center></pre></bdo></b><th id='xvx1a'></th></span></q></dt></tr></i><div id='xvx1a'><tfoot id='xvx1a'></tfoot><dl id='xvx1a'><fieldset id='xvx1a'></fieldset></dl></div>

        ASP.NET/HTML:ASP.NET (.cs) 中 HTML 按钮的 onClick 属性

        时间:2023-06-05
              <tbody id='S4z39'></tbody>
            <legend id='S4z39'><style id='S4z39'><dir id='S4z39'><q id='S4z39'></q></dir></style></legend>

              <tfoot id='S4z39'></tfoot>
                  <bdo id='S4z39'></bdo><ul id='S4z39'></ul>

                  <small id='S4z39'></small><noframes id='S4z39'>

                  <i id='S4z39'><tr id='S4z39'><dt id='S4z39'><q id='S4z39'><span id='S4z39'><b id='S4z39'><form id='S4z39'><ins id='S4z39'></ins><ul id='S4z39'></ul><sub id='S4z39'></sub></form><legend id='S4z39'></legend><bdo id='S4z39'><pre id='S4z39'><center id='S4z39'></center></pre></bdo></b><th id='S4z39'></th></span></q></dt></tr></i><div id='S4z39'><tfoot id='S4z39'></tfoot><dl id='S4z39'><fieldset id='S4z39'></fieldset></dl></div>

                  本文介绍了ASP.NET/HTML:ASP.NET (.cs) 中 HTML 按钮的 onClick 属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我只是想知道是否有办法将我的 onClick 事件放入 .cs:

                  I just wanna find out if there's a way to put my onClick event inside .cs:

                  <button type="submit" runat="server" id="btnLogin" class="button" onclick="btnLogin_Click();">
                  

                  Login_Click() 应该在 .cs 中的位置:

                  where Login_Click() should be inside .cs:

                  protected void btnLogin_Click(object sender, EventArgs e)
                  {
                      // do something
                  } 
                  

                  请注意,我不会在此处使用 ASP.NET 按钮,并且我不会将 Login_Click() 事件放入 .html/.aspx 中,因此我无法公开"我的代码.有什么建议吗?

                  Please do take note that I will not use ASP.NET button here, and that I will not put my Login_Click() event inside .html/.aspx so I can't 'expose' my codes. Any suggestions?

                  推荐答案

                  您可以在任何服务器控件上执行此操作,并且此按钮通过定义runat=server"成为服务器控件.问题可能出在您对事件的定义中:

                  You can do that on any server control and this button is made a server control by defining "runat=server". The problem is probably in your definition of the event:

                  <button ... runat="server" ... onServerClick="btnLogin_Click" />
                  

                  那里不需要();"...

                  除此之外,你能解释一下为什么你不在这里使用 <asp:Button> 因为我真的看不出有什么问题...

                  Apart from that can you explain why you don't use the <asp:Button> here because I don't really see a problem with that...

                  这篇关于ASP.NET/HTML:ASP.NET (.cs) 中 HTML 按钮的 onClick 属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:单击时,如何使用 C# 编写的 ActiveX 控件在 JavaS 下一篇:ASP.NET:如果使用 onclick,则不会调用 OnServerClick 事

                  相关文章

                  最新文章

                    <tfoot id='lIIXr'></tfoot>
                    <legend id='lIIXr'><style id='lIIXr'><dir id='lIIXr'><q id='lIIXr'></q></dir></style></legend>
                  1. <small id='lIIXr'></small><noframes id='lIIXr'>

                    1. <i id='lIIXr'><tr id='lIIXr'><dt id='lIIXr'><q id='lIIXr'><span id='lIIXr'><b id='lIIXr'><form id='lIIXr'><ins id='lIIXr'></ins><ul id='lIIXr'></ul><sub id='lIIXr'></sub></form><legend id='lIIXr'></legend><bdo id='lIIXr'><pre id='lIIXr'><center id='lIIXr'></center></pre></bdo></b><th id='lIIXr'></th></span></q></dt></tr></i><div id='lIIXr'><tfoot id='lIIXr'></tfoot><dl id='lIIXr'><fieldset id='lIIXr'></fieldset></dl></div>

                        <bdo id='lIIXr'></bdo><ul id='lIIXr'></ul>