Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Friday, November 28, 2014 9:29 AM
I wants to create an html table from generic list using csharp and pouplate in UI using javascript...
All replies (1)
Monday, December 1, 2014 8:11 AM âś…Answered | 1 vote
Hello Anitha K,
Visual Studio General forum maybe not the right forum for your case. For your first part of question, you may refer to some threads like the following:
Maybe you are seaching for code like the following:
var html = GetMyTable(people, x => x.LastName, x => x.FirstName);
public static string GetMyTable<T>(IEnumerable<T> list,params Func<T,object>[] fxns)
{
StringBuilder sb = new StringBuilder();
sb.Append("<TABLE>\n");
foreach (var item in list)
{
sb.Append("<TR>\n");
foreach(var fxn in fxns)
{
sb.Append("<TD>");
sb.Append(fxn(item));
sb.Append("</TD>");
}
sb.Append("</TR>\n");
}
sb.Append("</TABLE>");
return sb.ToString();
}
However, like the second part "pouplate in UI using javascript", your issue is specific for web project and I would recommend you consider post your question to the right forum:
Best regards,
Barry
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.