Anybody see what’s going on with the code below. I’m trying to dynamically create LinkButtons with dynamic Text and ID values from the database.
rptHeadline.DataSource = ds;
LinkButton lb = new LinkButton
if (ds.Tables[0].Rows.Count <= 0) {
lb.Text = ds.Tables[0].Rows[0]["URL"].ToString();
lb.ID = ds.Tables[0].Rows[0]["URL"].ToString();
}
rptHeadline.DataBind();
The statement
LinkButton lb = new LinkButtonis incomplete. You need to add();to call the default constructor.