Let say that we have an object
class Entity
{
public string ID {get; set;}
public string Name {get; set;}
}
I want to bind properti
In the OnInit you are always making to null.. remove those code and keep in the page load..
only need to bind in the very first time not in all the post back.
Page_Load() {
if(!Page.IsPostBack)
{
if (EntityObject== null)
EntityObject= new EntityObject();
FormView.DataSource = new[] { EntityObject };
FormView.DataBind();
}
}