Hi, I'm using ASP.NET with C# and SQL. I have a BLL and DAL set up for interaction with SQL. I have a user input webform with a link button. I need the link button to post the input to the database and pass the new identity value on to the page it navigates to. Can someone please help me on the code for this? This is what I have so far:
protected void LinkButton1_Click(object sender, EventArgs e)
{
ObjectDastaSource1.InsertParameters["Name"].DefaultValue=(FindControl("txtName") as Textbox).Text;
ObjectDataSource1.InsertParameters["User"].DefaultValue=(FindControl("ddlUser")as DropDownList).SelectedItem.Text;
ObjectDataSource1.InsertParameters["Email"].DefaultValue=(FindControl("txtEmail")as Textbox).Text;
ObjectDataSource1.InsertParameters["Start"].DefaultValue=(FindControl("cStart") as Calendar).SelectedDate.ToShortDateString();
ObjectDataSource1.Insertparameters["End"].DefaultValue=(FindControl("cEnd") as Calendar).SelectedDate.ToShortDateString();
ObjectDataSource.DataBind();