国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

directory search
ASP.NET 基礎(chǔ)教程 ASP.NET 教程 Web Pages - 教程 Web Pages - 添加 Razor 代碼 Web Pages - 頁(yè)面布局 Web Pages - 文件夾 Web Pages - 全局頁(yè)面 Web Pages - HTML 表單 Web Pages - 對(duì)象 Web Pages - 文件 Web Pages - 幫助器 Web Pages - WebGrid 幫助器 Web Pages - Chart 幫助器 Web Pages - WebMail 幫助器 Web Pages - PHP Web Pages - 發(fā)布網(wǎng)站 Razor - 標(biāo)記 Web Pages - Database 對(duì)象 ASP.NET MVC Web Forms - 教程 Web Forms - HTML 頁(yè)面 Web Forms - 服務(wù)器控件 Web Forms - 事件 Web Forms - HTML 表單 Web Forms - 維持 ViewState Web Forms - TextBox 控件 Web Forms - Button 控件 Web Forms - 數(shù)據(jù)綁定 Web Forms - ArrayList 對(duì)象 Web Forms - Hashtable 對(duì)象 Web Forms - SortedList 對(duì)象 Web Forms - XML 文件 Web Forms - Repeater 控件 Web Forms - DataList 控件 Web Forms - 數(shù)據(jù)庫(kù)連接 Web Forms - 母版頁(yè) Web Forms - 導(dǎo)航 ASP.NET Razor Razor - C# 和 VB 代碼語(yǔ)法 Razor - C# 變量 Razor - C# 循環(huán)和數(shù)組 Razor - C# 邏輯條件 Razor - VB 變量 Razor - VB 循環(huán)和數(shù)組 Razor - VB 邏輯條件 WF 參考手冊(cè) Web Forms - HTML 服務(wù)器控件 ASP.NET HtmlAnchor 控件 ASP.NET HtmlButton 控件 ASP.NET HtmlForm 控件 ASP.NET HtmlGeneric 控件 ASP.NET HtmlImage 控件 ASP.NET HtmlInputButton 控件 ASP.NET HtmlInputCheckBox 控件 ASP.NET HtmlInputFile 控件 ASP.NET HtmlInputHidden 控件 ASP.NET HtmlInputImage 控件 ASP.NET HtmlInputRadioButton 控件 ASP.NET HtmlInputText 控件 ASP.NET HtmlSelect Control ASP.NET HtmlTable 控件 ASP.NET HtmlTableCell 控件 ASP.NET HtmlTableRow 控件 ASP.NET HtmlTextArea 控件 ASP.NET AdRotator 控件 ASP.NET AdRotator AdvertisementFile 屬性 ASP.NET AdRotator Target 屬性 ASP.NET Button 控件 ASP.NET Button CausesValidation 屬性 ASP.NET Button OnClientClick 屬性 ASP.NET Button PostBackUrl 屬性 ASP.NET Button Text 屬性 ASP.NET Button UseSubmitBehavior 屬性 ASP.NET Button ValidationGroup 屬性 ASP.NET Calendar 控件 ASP.NET Calendar Caption 屬性 ASP.NET Calendar CaptionAlign 屬性 ASP.NET Calendar CellPadding 屬性 ASP.NET Calendar CellSpacing 屬性 ASP.NET Calendar DayHeaderStyle 屬性 ASP.NET Style 控件 ASP.NET BackColor 屬性 ASP.NET BorderColor 屬性 ASP.NET BorderStyle 屬性 ASP.NET BorderWidth 屬性 ASP.NET CssClass 屬性 ASP.NET Font 屬性 ASP.NET ForeColor 屬性 ASP.NET Height 屬性 ASP.NET Width 屬性 ASP.NET Calendar DayNameFormat 屬性 ASP.NET Calendar DayStyle 屬性 ASP.NET Calendar FirstDayOfWeek 屬性 ASP.NET Calendar NextMonthText 屬性 ASP.NET Calendar NextPrevFormat 屬性 ASP.NET Calendar NextPrevStyle 屬性 ASP.NET Calendar OtherMonthDayStyle 屬性 ASP.NET Calendar PrevMonthText 屬性 ASP.NET Calendar SelectedDate 屬性 ASP.NET Calendar SelectedDates 屬性 ASP.NET Calendar SelectedDayStyle 屬性 ASP.NET Calendar SelectionMode 屬性 ASP.NET Calendar SelectMonthText 屬性 ASP.NET Calendar SelectorStyle 屬性 ASP.NET Calendar SelectWeekText 屬性 ASP.NET Calendar ShowDayHeader 屬性 ASP.NET Calendar ShowGridLines 屬性 ASP.NET Calendar ShowNextPrevMonth 屬性 ASP.NET Calendar ShowTitle 屬性 ASP.NET Calendar TitleFormat 屬性 ASP.NET Calendar TitleStyle 屬性 ASP.NET Calendar TodayDayStyle 屬性 ASP.NET Calendar TodaysDate 屬性 ASP.NET Calendar VisibleDate 屬性 ASP.NET Calendar WeekendDayStyle 屬性 ASP.NET CalendarDay 控件 ASP.NET CalendarDay Date 屬性 ASP.NET CalendarDay DayNumberText 屬性 ASP.NET CalendarDay IsOtherMonth 屬性 ASP.NET CalendarDay IsSelectable 屬性 ASP.NET CalendarDay IsSelected 屬性 ASP.NET CalendarDay IsToday 屬性 ASP.NET CalendarDay IsWeekend 屬性 ASP.NET CheckBox 控件 ASP.NET CheckBox Checked 屬性 ASP.NET CheckBox Text 屬性 ASP.NET CheckBox TextAlign 屬性 ASP.NET CheckBoxList 控件 ASP.NET CheckBoxList CellPadding 屬性 ASP.NET CheckBoxList CellSpacing 屬性 ASP.NET CheckBoxList RepeatColumns 屬性 ASP.NET CheckBoxList RepeatDirection 屬性 ASP.NET CheckBoxList RepeatLayout 屬性 ASP.NET CheckBoxList TextAlign 屬性 ASP.NET DropDownList 控件 ASP.NET DropDownList SelectedIndex 屬性 ASP.NET HyperLink 控件 ASP.NET HyperLink ImageUrl 屬性 ASP.NET HyperLink NavigateUrl 屬性 ASP.NET HyperLink Target 屬性 ASP.NET HyperLink Text 屬性 ASP.NET Image 控件 ASP.NET Image AlternateText 屬性 ASP.NET Image ImageAlign 屬性 ASP.NET Image ImageUrl 屬性 ASP.NET ImageButton 控件 ASP.NET ImageButton CausesValidation 屬性 ASP.NET ImageButton ValidationGroup 屬性 ASP.NET ImageButton PostBackUrl 屬性 ASP.NET ImageButton ValidationGroup 屬性 ASP.NET Label 控件 ASP.NET LinkButton 控件 ASP.NET LinkButton OnClientClick 屬性 ASP.NET LinkButton PostBackUrl 屬性 ASP.NET LinkButton Text 屬性 ASP.NET LinkButton ValidationGroup 屬性 ASP.NET ListBox 控件 ASP.NET Rows 屬性 ASP.NET SelectionMode 屬性 ASP.NET ListItem 控件 ASP.NET ListItem Enabled 屬性 ASP.NET ListItem Selected 屬性 ASP.NET ListItem Text 屬性 ASP.NET ListItem Value 屬性 ASP.NET Literal 控件 ASP.NET Literal Text 屬性 ASP.NET Panel 控件 ASP.NET Panel BackImageUrl 屬性 ASP.NET Panel DefaultButton 屬性 ASP.NET Panel Direction 屬性 ASP.NET Panel GroupingText 屬性 ASP.NET Panel HorizontalAlign 屬性 ASP.NET Panel ScrollBars 屬性 ASP.NET Panel Wrap 屬性 ASP.NET PlaceHolder 控件 ASP.NET RadioButton 控件 ASP.NET RadioButtonList 控件 ASP.NET RadioButtonList CellPadding 屬性 ASP.NET RadioButtonList CellSpacing 屬性 ASP.NET RadioButtonList RepeatColumns 屬性 ASP.NET RadioButtonList RepeatDirection 屬性 ASP.NET RadioButtonList TextAlign 屬性 ASP.NET BulletedList BulletImageUrl 屬性 Web Forms - Web 服務(wù)器控件 ASP.NET Table 控件 ASP.NET BackImageUrl 屬性 ASP.NET Caption 屬性 ASP.NET CaptionAlign 屬性 ASP.NET CellPadding 屬性 ASP.NET CellSpacing 屬性 ASP.NET GridLines 屬性 ASP.NET HorizontalAlign 屬性 ASP.NET TableCell 控件 ASP.NET TableCell ColumnSpan 屬性 ASP.NET TableCell HorizontalAlign 屬性 ASP.NET TableCell RowSpan 屬性 ASP.NET TableCell Text 屬性 ASP.NET TableCell Wrap 屬性 ASP.NET TableRow 控件 ASP.NET TableRow HorizontalAlign 屬性 ASP.NET TableRow TableSection 屬性 ASP.NET TableRow VerticalAlign 屬性 ASP.NET TextBox 控件 ASP.NET TextBox AutoCompleteType 屬性 ASP.NET TextBox AutoPostBack 屬性 ASP.NET TextBox Columns 屬性 ASP.NET TextBox MaxLength 屬性 ASP.NET TextBox ReadOnly 屬性 ASP.NET TextBox Rows 屬性 ASP.NET TextBox Text 屬性 ASP.NET TextBox TextMode 屬性 ASP.NET TextBox Wrap 屬性 ASP.NET XML 控件 ASP.NET XML DocumentSource 屬性 Web Forms - Validation 服務(wù)器控件 ASP.NET CompareValidator 控件 ASP.NET CustomValidator 控件 ASP.NET RangeValidator 控件 ASP.NET RegularExpressionValidator 控件 ASP.NET RequiredFieldValidator 控件 ASP.NET ValidationSummary 控件 ASP.NET BulletedList 控件 ASP.NET BulletedList BulletStyle 屬性 ASP.NET BulletedList DisplayMode 屬性 ASP.NET BulletedList FirstBulletNumber 屬性 ASP.NET BulletedList Target 屬性 WP 參考手冊(cè) Web Pages - 類 Web Pages - WebSecurity 對(duì)象 WebSecurity 屬性 - CurrentUserId WebSecurity 屬性 -?CurrentUserName WebSecurity 屬性 - HasUserId WebSecurity 屬性 - IsAuthenticated WebSecurity - ChangePassword() WebSecurity - ConfirmAccount() WebSecurity - CreateAccount() WebSecurity - CreateUserAndAccount() WebSecurity - GeneratePasswordResetToken() WebSecurity - GetCreateDate() WebSecurity - GetPasswordChangeDate() WebSecurity - GetUserId() WebSecurity - InitializeDatabaseConnection() WebSecurity - IsConfirmed() WebSecurity - IsCurrentUser() WebSecurity - Login() WebSecurity - Logout() WebSecurity - RequireAuthenticatedUser() WebSecurity - RequireRoles() WebSecurity - RequireUser() WebSecurity - ResetPassword() WebSecurity - UserExists() Web Pages - WebMail 對(duì)象 Web Pages - 更多幫助器
characters

Web Forms - ArrayList 對(duì)象



ArrayList 對(duì)象是包含單個(gè)數(shù)據(jù)值的項(xiàng)目的集合。


在線實(shí)例

ArrayList DropDownList

<script??runat="server">
sub?Page_Load
if?Not?Page.IsPostBack?then
???dim?mycountries=New?ArrayList
???mycountries.Add("Norway")
???mycountries.Add("Sweden")
???mycountries.Add("France")
???mycountries.Add("Italy")
???mycountries.TrimToSize()
???mycountries.Sort()
???dd.DataSource=mycountries
???dd.DataBind()
end?if
end?sub

sub?displayMessage(s?as?Object,e?As?EventArgs)
lbl1.text="Your?favorite?country?is:?"?&?dd.SelectedItem.Text
end?sub
</script>

<!DOCTYPE?html>
<html>
<body>

<form?runat="server">
<asp:DropDownList?id="dd"?runat="server"
AutoPostBack="True"?onSelectedIndexChanged="displayMessage"?/>
<p><asp:label?id="lbl1"?runat="server"?/></p>
</form>

</body>
</html>

ArrayList RadioButtonList

<script??runat="server">
Sub?Page_Load
if?Not?Page.IsPostBack?then
???dim?mycountries=New?ArrayList
???mycountries.Add("Norway")
???mycountries.Add("Sweden")
???mycountries.Add("France")
???mycountries.Add("Italy")
???mycountries.TrimToSize()
???mycountries.Sort()
???rb.DataSource=mycountries
???rb.DataBind()
end?if
end?sub

sub?displayMessage(s?as?Object,e?As?EventArgs)
lbl1.text="Your?favorite?country?is:?"?&?rb.SelectedItem.Text
end?sub
</script>

<!DOCTYPE?html>
<html>
<body>

<form?runat="server">
<asp:RadioButtonList?id="rb"?runat="server"
AutoPostBack="True"?onSelectedIndexChanged="displayMessage"?/>
<p><asp:label?id="lbl1"?runat="server"?/></p>
</form>

</body>
</html>

創(chuàng)建 ArrayList

ArrayList 對(duì)象是包含單個(gè)數(shù)據(jù)值的項(xiàng)目的集合。

通過(guò) Add() 方法向 ArrayList 添加項(xiàng)目。

下面的代碼創(chuàng)建了一個(gè)名為 mycountries 的 ArrayList 對(duì)象,并添加了四個(gè)項(xiàng)目:

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
dim mycountries=New ArrayList
mycountries.Add("Norway")
mycountries.Add("Sweden")
mycountries.Add("France")
mycountries.Add("Italy")
end if
end sub
</script>

在默認(rèn)情況下,一個(gè) ArrayList 對(duì)象包含 16 個(gè)條目??赏ㄟ^(guò) TrimToSize() 方法把 ArrayList 調(diào)整為最終尺寸:

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
dim mycountries=New ArrayList
mycountries.Add("Norway")
mycountries.Add("Sweden")
mycountries.Add("France")
mycountries.Add("Italy")
mycountries.TrimToSize()
end if
end sub
</script>

通過(guò) Sort() 方法,ArrayList 也能夠按照字母順序或者數(shù)字順序進(jìn)行排序:

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
dim mycountries=New ArrayList
mycountries.Add("Norway")
mycountries.Add("Sweden")
mycountries.Add("France")
mycountries.Add("Italy")
mycountries.TrimToSize()
mycountries.Sort()
end if
end sub
</script>

要實(shí)現(xiàn)反向排序,請(qǐng)?jiān)?Sort() 方法后應(yīng)用 Reverse() 方法:

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
dim mycountries=New ArrayList
mycountries.Add("Norway")
mycountries.Add("Sweden")
mycountries.Add("France")
mycountries.Add("Italy")
mycountries.TrimToSize()
mycountries.Sort()
mycountries.Reverse()
end if
end sub
</script>

綁定數(shù)據(jù)到 ArrayList

ArrayList 對(duì)象可為下列的控件自動(dòng)生成文本和值:

  • asp:RadioButtonList
  • asp:CheckBoxList
  • asp:DropDownList
  • asp:Listbox

為了綁定數(shù)據(jù)到 RadioButtonList 控件,首先要在 .aspx 頁(yè)面中創(chuàng)建一個(gè) RadioButtonList 控件(不帶任何 asp:ListItem 元素):

<html>
<body>

<form runat="server">
<asp:RadioButtonList id="rb" runat="server" />
</form>

</body>
</html>

然后添加創(chuàng)建列表的腳本,并且綁定列表中的值到 RadioButtonList 控件:

實(shí)例

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
dim mycountries=New ArrayList
mycountries.Add("Norway")
mycountries.Add("Sweden")
mycountries.Add("France")
mycountries.Add("Italy")
mycountries.TrimToSize()
mycountries.Sort()
rb.DataSource=mycountries
rb.DataBind()
end if
end sub
</script>

<html>
<body>

<form runat="server">
<asp:RadioButtonList id="rb" runat="server" />
</form>

</body>
</html>
?

RadioButtonList 控件的 DataSource 屬性被設(shè)置為該 ArrayList,它定義了這個(gè) RadioButtonList 控件的數(shù)據(jù)源。RadioButtonList 控件的 DataBind() 方法把 RadioButtonList 控件與數(shù)據(jù)源綁定在一起。

注釋:數(shù)據(jù)值作為控件的 Text 和 Value 屬性來(lái)使用。如需添加不同于 Text 的 Value,請(qǐng)使用 Hashtable 對(duì)象或者 SortedList 對(duì)象。


Previous article: Next article: