的CommandName =登录

编程入门 行业动态 更新时间:2024-10-28 08:26:46
本文介绍了的CommandName =登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道ASP.Net在启动新网站时自动生成的登录按钮内的编码。按钮是Login.aspx形式,并在asp:登录标签上。 它是这样说的:

Hi, i would like to know the coding inside the login button that the ASP.Net generates automatically when i start the new Website. the button is in the Login.aspx form and insite the asp:Login tag. it says like this :

<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup"/>

我很好奇: 1. CommandName =登录这是什么? 2. ASP.Net在哪里放置代码来执行它?因为我想知道ASP.Net是如何为我登录的。 很多。

I curious with : 1. CommandName = "Login" what is that ? 2. Where ASP.Net put the code to execute it ? since i want to see how ASP.Net do login for me. thanx a lot.

推荐答案

这在按钮事件处理程序中使用,可以通过属性OnCommand设置。然后在事件处理程序中,您可以访问类型CommandEventArgs的参数并检查值e.CommandName,其中e是CommandEventArgs参数的名称。 它可以用于有一个处理程序方法来执行根据你的程序流程,工作多个按钮或不同的工作。 请阅读以下链接指向的示例,非常清楚: http:// msdn。 microsoft/en-us/library/system.web.ui.webcontrols.buttonmandname.aspx 干杯, Manfred Hi, this is used in the buttons event handler that can be set via attribute OnCommand. Then in the event handler you can access the parameter of type CommandEventArgs and inspect the value e.CommandName where e is the name of the CommandEventArgs parameter. It can be used to have one handler method that does the work for more than one button or different jobs depending on your program flow. Please read the example the following link points to, it's pretty clear: msdn.microsoft/en-us/library/system.web.ui.webcontrols.buttonmandname.aspx Cheers, Manfred

更多推荐

的CommandName =登录

本文发布于:2023-11-09 09:07:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571983.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:CommandName

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!