I have a typical object (it comes from Linq but it could have been create manually):
public class Person
{
public string FirstName{get; set;}
public string LastName{get; set;}
public int Age{get; set;}
}
And I have a Web Form where users enter this data:
<asp:TextBox runat="server" ID="FirstName"></asp:TextBox>
<asp:TextBox runat="server" ID="LastName"></asp:TextBox>
<asp:TextBox runat="server" ID="Age"></asp:TextBox>
How do I bind the data from the Control to the class? I could do this:
Person person;
person.FirstName = FirstName.Text;
but is there something better where the class or Linq just sucks in the Control values automatically?