All of us have seen a comment box on various websites. In this Post, we will learn how to create a Simple Comment Box in ASP.NET. For demonstration, I have created a database (named as Database). The following is the table design for creating tbl_Comment.
Let's Begin:
1. Create an Empty ASP.NET Website and Add a Web Form (Default.aspx) to it.
2. Inside of div tag, create a table with 3 columns and 4 rows.
3. Drop the Label control and TextBox Control in the first and second column. Change the TextMode property for the Comment TextBox to MultiLine.
4. Drop Button Control and Set Id as btn_Submit and Text as Post Comment.
Preview:
5. Drop two Repeater Control after the table tag. One for displaying the comments and other for displaying paging.
Default.aspx Code:
Default.aspx.cs Code
Web.config code