开发者

Complete (or semi-complete) list of asp.net control client side events? [closed]

开发者 https://www.devze.com 2023-03-12 16:50 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this po
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 1 year ago.

Improve this question

I would prefer that my asp.net pages be a bit more user responsive, so I'm adding Javascript events events to the asp.net controls. I've found some of the more obvious events by searching around, b开发者_开发知识库ut I'm wondering if anyone knows of a good reference source for a complete (or semi-complete) list of asp.net controls and their corresponding available client side events?

If there is some really obvious answer to this, I apologize in advance - and please point me in the right direction... :-)


First, you can refer to w3c html documentation to learn which events are available for html elements. Even if ASP.NET control do not support adding a client-side event handler using control properties, you can always do it in javascript (and with jQuery and ASP.NET 4 predictable client id generation it's really easy). (EDIT: as Tim Schmelter pointed out in comment, you can also use attribute collection for this purpose, for instance: Button1.Attributes.Add("onclick", "alert('hello, world')");)

Also you can refer to MSDN and check all classes that inherit from System.Web.UI.Control.

Also you can check out the MVC way of building web sites which is pretty different from WebForms way.

0

精彩评论

暂无评论...
验证码 换一张
取 消