.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Getting the SelectionList Value

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net
 

Hi -- Need some help with a simple but couldn't find a solution problem. I have a mobile selection list (see blow) that I had programmatically filled in from a generic collection of Status object (see below) which was retrieved from the database since I wanted to use the ID and Value stored in there to the selection list.


Mobile SelectionList Sample


<mobile:SelectionList Runat="server" ID="SelListStatus">
</mobile:SelectionList>


Status Object model


public class Status
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }


Filled in a generic collection of Status object

var statusList = new List<Status>();
......
while (reader.Read())
{
	var status = new Status
	{
		Id = Convert.ToInt16(reader["StatusId"]),
		Name = (string)reader["StatusName"]
	};
	statusList.Add(status);
}

..
....
return statusList;


Then, I tried to fill in the mobile selection list control using:



View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend