
February 18th, 2013, 05:30 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Posts: 305
Time spent in forums: 5 Days 18 h 57 m 35 sec
Reputation Power: 0
|
|
|
Set & Get problem
Hi Everyone,
How can I make the code inside the "GetData()" function work ?
Thanks,
May
public class LinkInfo
{
public string ProductUrl { get; set; }
public string ProductName { get; set; }
}
public static class PopulateRepeater
{
static List<LinkInfo> objList;
public static IEnumerable<LinkInfo> GetData()
{
LinkInfo.ProductUrl = "www.yahoo.com";
LinkInfo.ProductName = "yahoo";
objList.Add(LinkInfo);
LinkInfo.ProductUrl = "www.hotmail.com";
LinkInfo.ProductName = "hotmail";
objList.Add(LinkInfo);
LinkInfo.ProductUrl = "www.dell.ca";
LinkInfo.ProductName = "dell inc.";
objList.Add(LinkInfo);
//code to fetch link info drom database here
return objList;
}
}
|