using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
namespace examples_Post
{
public partial class exp9 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Creating the arraylist values to bind them to datalist
ArrayList myarraylist = new ArrayList(3);
myarraylist.Add("Damien");
myarraylist.Add("David");
myarraylist.Add("Campbell");
myarraylist.Add("Cairns");
myarraylist.Add("Anthony");
myarraylist.Add("Cieran");
// Setting the datasource property of datalist to the array 'myarraylist'
dlTest.DataSource = myarraylist;
//Binding the myarraylist values to datalsit
dlTest.DataBind();
}
}
}
==
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DataList ID="dlTest" runat="server" ForeColor="#000000" BackColor="Beige"
CellPadding="3" GridLines="none" Width="50%">
<ItemStyle Font-Size="Large" BackColor="Beige"/>
<AlternatingItemStyle Font-Size="Medium" BackColor="Orchid" />
<ItemTemplate>
<%# Container.DataItem %>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html>
ASP Standard Controls
- ASP Label Control
- ASP TextBox Control
- ASP Button Control
- ASP Link Button Control
- ASP ImageButton Control
- ASP HyperLink Control
- ASP DropDownList Control
- ASP ListBox Control
- ASP CheckBox Control
- ASP CheckBoxList Control
- ASP RadioButton Control
- ASP RadioButtonList Control
- ASP Image Control
- ASP ImageMap Control
- ASP Calendar Control
- ASP Table Control
- ASP BulletedList Control
- ASP Hidden Control
- ASP Literal Control
- ASP AdRotator Control
- ASP Panel Control
- ASP PlaceHolder Control
- ASP FileUpload Control
- ASP UserControl
- ASP Custom Control
Random Tips and Tricks
Thursday, September 16, 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment