I Want to bind detailsview to the page manually , for example
I Have a linqdatasource as declared here in design mode..
On a page load event I have written following..
protected void Page_Load(object sender, EventArgs e)
{
DetailsView dv = new DetailsView();
dv.AllowPaging = true;
dv.DataSource = LinqDataSource1;
dv.DataBind();
this.Controls.Add(dv);
}
but i got error like this..
Control 'ctl02' of type 'DetailsView' must be placed inside a form tag with runat=server.