的CommandName =登录 [英] CommandName=Login

查看:125
本文介绍了的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.com/en-us/library/system.web.ui.webcontrols.button.commandname.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:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.commandname.aspx


Cheers,


Manfred


这篇关于的CommandName =登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆