</asp:DropDownList>
加上壹個 AutoPostBack=True 這樣才有反應,也要寫個後臺事件
在頁面上雙擊壹下這個頁面就會添加上事件了
加完是這樣的:
<asp:DropDownList ID="face" runat="server" AutoPostBack=True OnSelectedIndexChanged="face_SelectedIndexChanged" Width="63px">
</asp:DropDownList>
後臺會有壹個:
protected void face_SelectedIndexChanged(object sender, EventArgs e)
{ //在裏面寫:
tupian1.src='images/userface/'+(face.SelectValue)+'.gif';
}