當前位置:編程學習大全網 - 網站源碼 - asp.net 留言板

asp.net 留言板

<asp:DropDownList ID="face" runat="server" onChange="tupian1.src='images/userface/'+(this.options.selectedIndex)+'.gif';" Width="63px">

</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';

}

  • 上一篇:word如何實現奇偶頁雙面打印,不用手動翻頁?
  • 下一篇:關於建站 wp建站 dede dz
  • copyright 2024編程學習大全網