简单教程
提交运行
代码编辑器:
<script runat="server"> Sub button1(Source As Object, e As ImageClickEventArgs) p1.InnerHtml="You clicked the smiley button!" End Sub Sub button2(Source As Object, e As ImageClickEventArgs) p1.InnerHtml="You clicked the angry button!" End Sub </script> <!DOCTYPE html> <meta charset="utf-8" /> <form runat="server"> <p>Click on one of the images:</p> <p> <input type="image" src="/static/i/smiley.gif" OnServerClick="button1" runat="server" width="32" height="32" /> </p> <p> <input type="image" src="/static/i/angry.gif" OnServerClick="button2" runat="server" width="32" height="32" /> </p> <p id="p1" runat="server" /> </form>
运行结果: