@634

ASP.NET - WEBフォームコントロール - asp:DropDownList

Advertisement

用途

asp:DropDownListコントロールを使用すると、ドロップダウンリストを利用することができる。

書式

<asp:DropDownList id="コントロールID" runat="server">
    <asp:ListItem Value="値">テキスト</asp:ListItem>
</asp:DropDownList>
※上記の属性以外にも、見栄えの定義などの属性があります。

サンプル

サンプルコード
<form runat="server">
<asp:DropDownList id="DropDownList01" runat="server">
    <asp:ListItem Value="tokyo">東京都</asp:ListItem>
    <asp:ListItem Value="kanagawa">神奈川県</asp:ListItem>
    <asp:ListItem Value="saitama">埼玉県</asp:ListItem>
    <asp:ListItem Value="chiba">千葉県</asp:ListItem>
</asp:DropDownList>
</form>

実行イメージ

イベント

SelectedIndexChanged

Advertisement

ショートカット

634
634ブログ
このカテゴリのトップページに戻る
Incubator(Pukiwiki)
634ラボ
   UIコレクションギャラリー
   ZO-3ジェネレーター

サイト検索


Y!ログール