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.
精彩评论