ASP.NET서버컨트롤, asp:dropdownlist[C#, ASP.NET강좌]
HTML에서 <select>와 <option> 태그를 사용하는 것이다.
<select> 대신 <asp:dropdownlist> 태그가 사용
<option> 대신 <asp:listitem> 태그가 사용
Name 속성 대신 id 속성 사용
<option> 대신 <asp:listitem> 태그가 사용
Name 속성 대신 id 속성 사용
(onj5.aspx)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="onj5.aspx.cs" Inherits="onjweb1.onj5" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<asp:label id="msg" runat="server"/><br/><br/>
<form id="form1" runat="server">
좋아하는과목선택하세요~ <br/><br/>
<asp:dropdownlist id="list1" runat="server">
<asp:listitem>오라클</asp:listitem>
<asp:listitem selected>닷넷</asp:listitem>
<asp:listitem>자바</asp:listitem>
</asp:dropdownlist>
<br/><br/>
<input type="submit">
</form>
</body>
</html>
(onj5.aspx.cs)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace onjweb1
{
public partial class onj5 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Form["list1"] != null)
{
msg.Text = Request.Form["list1"];
}
}
}
}
{
public partial class onj5 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Form["list1"] != null)
{
msg.Text = Request.Form["list1"];
}
}
}
}
오라클자바커뮤니티에서 설립한 개발자교육6년차 오엔제이프로그래밍 실무교육센터(오라클SQL,튜닝,힌트,자바프레임워크,안드로이드,아이폰,닷넷 실무개발강의)
[개강안내]오라클자바커뮤니티에서 운영하는 개발자 전문교육 ,개인80%환급(www.onjprogramming.co.kr)
[주말]
[10/12]자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
[10/12]Spring3.X, MyBatis, Hibernate실무과정
[10/12]SQL초보에서실전전문가까지
[10/12]C#,ASP.NET마스터
[평일야간]
[10/10]SQL초보에서실전전문가까지
[10/15]자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
[10/17]Spring3.X, MyBatis, Hibernate실무과정
[평일주간]
[10/10]Spring3.X, MyBatis, Hibernate실무과정
[10/17]PL/SQL,오라클힌트,SQL튜닝,사례연구
[주말]
[10/12]자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
[10/12]Spring3.X, MyBatis, Hibernate실무과정
[10/12]SQL초보에서실전전문가까지
[10/12]C#,ASP.NET마스터
[평일야간]
[10/10]SQL초보에서실전전문가까지
[10/15]자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
[10/17]Spring3.X, MyBatis, Hibernate실무과정
[평일주간]
[10/10]Spring3.X, MyBatis, Hibernate실무과정
[10/17]PL/SQL,오라클힌트,SQL튜닝,사례연구
댓글 없음:
댓글 쓰기