简单教程
提交运行
代码编辑器:
<script runat="server"> Sub choose_image(Sender As Object, e As EventArgs) image1.Src = select1.Value End Sub </script> <!DOCTYPE html> <meta charset="utf-8" /> <form runat="server"> <select id="select1" runat="server"> <option value="/static/i/smiley.gif">Smiley</option> <option value="/static/i/angry.gif">Angry</option> <option value="/static/i/stickman.gif">Stickman</option> </select> <input type="submit" runat="server" value="Display image" OnServerClick="choose_image"> <br><br> <img id="image1" src="smiley.gif" runat="server" width="32" height="32" /> </form>
运行结果: