I am not quite sure how to attack this, basically I have two html fields in my aspx page:
<input type="text" name="fname" />
<input type="text" name="lname"/>
Now i would like to populate them from the server side when the page loads based on some data collected from the database, basically this data is stored in two properties
public string FirstName { get; set;}
public string LastName {get; set;}
How can I pass the value from such properties into the html inputs On_Load ?
I would appreciate the help.
Here is one way, assuming Webforms:
If using .NET before 4.0, replace the
<%:with<%=.Another option is to change the input types to be
runat="server"and assigning the values directly on the server side.