开发者

A simple asp.net feature

开发者 https://www.devze.com 2022-12-09 03:28 出处:网络
When I would be able to write : <asp:Text开发者_StackOverflowBox id=\"Input\" runat=\"server\"/> <asp:Button onclick=\"<% Input.Text=\'my input\' %>\" />

When I would be able to write :

<asp:Text开发者_StackOverflowBox id="Input" runat="server"/> <asp:Button onclick="<% Input.Text='my input' %>" />


Unfortunately with standard WebForms this simply isn't possible. The On<EventName> property expects a string which must correspond to the name of a method whose signature matches the event's handler delegate.

Essentially what you are describing is the ability to, inline, assign a lambda to be invoked when the event is raised. To add this functionality you would need to build your own ViewEngine to replace the existing WebForms one. This is hardly a trivial task, but it is possible, and it would be a very cool feature to have.

0

精彩评论

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