Ilist
How to use ilist in asp.net?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Priya LingeRank #785 · 2.9K reputationPosted Nov 16, 2011, 7:24 PM EST
1.The IList interface is defined in the System.Collections namespace and its equivalent
of the same name is defined in the System.Collections.Generic namespace.
2.Example :
//Namespace
using System.Collections.Generic;
private void BindData() userinfos = new List();
{
IList
for (int i = 0; i < 5; i++)
{
UserInfo info = new UserInfo("username" + i.ToString(), "password" + i.ToString());
userinfos.Add(info);
}
this.GridView1.DataSource = userinfos; //Bind data to GridView Control
this.GridView1.DataBind();
}
//Class UserInfo
public class UserInfo
{
private string _userName = string.Empty;
private string _password = string.Empty;
public UserInfo()
{
}
public UserInfo(string userName, string password)
{
this._userName = userName;
this._password = password;
}
public string UserName
{
get
{
return _userName;
}
}
public string Password
{
get
{
return _password;
}
}
}
3.Example of IList :Below link explain how to use IList .
http://www.csharpkey.com/aspnet/collections/introduction3.htm
Hope this will help you.
Thanks.
Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 16, 2011, 7:34 PM EST
Please refer the below link
http://www.aspnettutorials.com/tutorials/advanced/ilist-aspnet2-csharp.aspx
Thanks
Arjun PanwarRank #254 · 9.9K reputationPosted Nov 16, 2011, 10:33 PM EST