How does jQuery dynamically generate the button to implement event processing?
In the ASP. net mvc environment, a small function is implemented to dynamically use jQuery and allow users to execute the click Event of the button.
For better understanding and comparison, Insus. NET first writes a static object in the view, executes similar functions, and then uses the dynamically generated ammonium button.
JQuery events, the last time we learned the. on (xxx) "Learning jQuery on events" http://www.cnblogs.com/insus/p/4310999.html and today's dynamics, but need to learn a called. delegate (xxx ).
Controller:
View:
Mark A in the example and create the Action corresponding to the Controller in the corresponding controller directory.
Mark B in the text box. Fill in data.
Mark C, static button.
The tag D and div are used to dynamically load the ammonium button generated by jQuery dynamically.
Mark E and reference the jQuery class library.
Mark F, jQuery code:
Real-time Demonstration: