c# - How to bind ListView in asp.net from multiple tables? -


i using asp.net create website. in 1 of .aspx pages, display properties of given data model -

<asp:listview id="bidlist" runat="server"              datakeynames="bidid" groupitemcount="8"             itemtype="talker.models.model1" selectmethod="getcategorybids"> 

where model1 name of 1 of tables created , looks -

public class model1   {   [key]   public int model1id {get; set; }   public string providingusername {get; set;}   public user appuser { get; set; }   public int? userid { get; set; }  } 

and user class looks -

 public class user{     public string userid { get; set; }     public string username {get; set; }     public string fname { get; set; }     public string lname { get; set; }  }  

now, able display user name because field in model1. however, want display fname field user class based on username (which unique). i'm not sure how though. carry fname (and other information user) in model1 itself, involve carrying around lot of unnecessary information. site speed faster if users table become large , carried fields in model1 table?


Comments