T
Tom
<%@ Page Language="vb" AutoEventWireup="false"
EnableViewState="false" .... %>
<FORM id="frmMyForm" method="post" runat="server">
1) Inline Items (In aspx File) :
<ASPROPDOWNLIST id="drpStatesOne" runat="server"
enableviewstate="false">
<ASP:LISTITEM value="1">A</ASP:LISTITEM>
<ASP:LISTITEM value="2">B</ASP:LISTITEM>
<ASP:LISTITEM value="3">C</ASP:LISTITEM>
<ASP:LISTITEM value="4">D</ASP:LISTITEM>
</ASPROPDOWNLIST>
<BR>
2) Items added in Page_Init Event :
<ASPROPDOWNLIST id="drpStatesTwo" runat="server"
enableviewstate="false">
</ASPROPDOWNLIST>
<BR>
3) Items added in Page_Load Event :
<ASPROPDOWNLIST id="drpStatesThree" runat="server"
enableviewstate="false">
</ASPROPDOWNLIST>
<BR>
<INPUT type=submit value="Check It">
</FORM>
Code Behind ....
Private Sub Page_Init(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Init
InitializeComponent()
With drpStatesTwo
.Items.Add("A")
.Items.Add("B")
.Items.Add("C")
.Items.Add("D")
End With
End Sub
Protected drpStatesOne As
System.Web.UI.WebControls.DropDownList
Protected drpStatesTwo As
System.Web.UI.WebControls.DropDownList
Protected drpStatesThree As
System.Web.UI.WebControls.DropDownList
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
With drpStatesThree
.Items.Add("A")
.Items.Add("B")
.Items.Add("C")
.Items.Add("D")
End With
End Sub
EnableViewState="false" .... %>
<FORM id="frmMyForm" method="post" runat="server">
1) Inline Items (In aspx File) :
<ASPROPDOWNLIST id="drpStatesOne" runat="server"
enableviewstate="false">
<ASP:LISTITEM value="1">A</ASP:LISTITEM>
<ASP:LISTITEM value="2">B</ASP:LISTITEM>
<ASP:LISTITEM value="3">C</ASP:LISTITEM>
<ASP:LISTITEM value="4">D</ASP:LISTITEM>
</ASPROPDOWNLIST>
<BR>
2) Items added in Page_Init Event :
<ASPROPDOWNLIST id="drpStatesTwo" runat="server"
enableviewstate="false">
</ASPROPDOWNLIST>
<BR>
3) Items added in Page_Load Event :
<ASPROPDOWNLIST id="drpStatesThree" runat="server"
enableviewstate="false">
</ASPROPDOWNLIST>
<BR>
<INPUT type=submit value="Check It">
</FORM>
Code Behind ....
Private Sub Page_Init(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Init
InitializeComponent()
With drpStatesTwo
.Items.Add("A")
.Items.Add("B")
.Items.Add("C")
.Items.Add("D")
End With
End Sub
Protected drpStatesOne As
System.Web.UI.WebControls.DropDownList
Protected drpStatesTwo As
System.Web.UI.WebControls.DropDownList
Protected drpStatesThree As
System.Web.UI.WebControls.DropDownList
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
With drpStatesThree
.Items.Add("A")
.Items.Add("B")
.Items.Add("C")
.Items.Add("D")
End With
End Sub