Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Hw cn insert commt,if txtbx btn r in datalist
Gaurav Raj
Mar 20 2017 3:30 AM
158
Reply
protected void Button2_Click(object sender, EventArgs e) { string Id = ((Button)sender).CommandArgument; com.User_Id = Convert.ToInt32(Session["Id"]); com.Blog_Id = Convert.ToInt32(Id); foreach (DataListItem dli in DataList1.Items) { TextBox text = (TextBox)dli.FindControl("CommentText"); com.Comment = text.Text; } cs.da.CommentTables.InsertOnSubmit(com); cs.da.SubmitChanges(); Response.Redirect(Request.Url.AbsoluteUri);//prevent to reinsert data after refresh data UpdatePanel1.Update(); }
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to print XAML multiple pages in silver light
Change the code from old to new