protected void Delete_Click(object sender, EventArgs e) { CommentDataSource.Delete(); ShareDataSource.Delete(); ImageDataSource.Delete(); Response.Redirect("YourPictures.aspx"); }
protected void Addcomment_Click(object sender, EventArgs e) { DataView productsTable = (DataView)ImageDataSource.Select(DataSourceSelectArguments.Empty); DataRowView row = (DataRowView)productsTable[0]; string imageid = row["ImageID"].ToString(); CommentDataSource.InsertParameters["Commenter"].DefaultValue = HttpContext.Current.User.Identity.Name; CommentDataSource.InsertParameters["ImageID"].DefaultValue = imageid; CommentDataSource.InsertParameters["CommentText"].DefaultValue = Comment.Text; CommentDataSource.Insert(); }