After viewing the article it is clear that the article was written for ASP.NET 1._
In your code I see your declaring a textbox (name as textbox). In ASP.NET 1._ you needed to do this for server controls that were in your html. In ASP.NET 2.0 you do not need to do this; it is handled for you. If your developing in ASP.NET 2.0, then you
should be able to remove all of the following from you code:
Public name As TextBox
Public location As TextBox
Public email As TextBox
Public website As TextBox
Public comment As TextBox
Public lbName As Label
Public lbLocation As Label
Public lbComment As Label
If you get stuck trying to convert this code, you could use my comments page for my blog as a model for a guestbook. Reviewing the source code for my site, you would need to do the following:
Create a new table similar to blog_Comments, change the names to reflect a guestbook, and add any additional columns you wish to use.
Copy the CommentManager.vb and change everything in it to align with your new guestbook table in the database.
Copy all of the comment stored procedures and change their names and code to align with everything in the Guestbook.vb class that you created from the CommentManager.vb
Copy the Comments.aspx and rename it to Guestbook.aspx. Change the names of controls to match Guestbook. Modify and add any additional items to the datalist. Modify the code behind to reference Guestbook instead of Comments.
jwadsworth
Contributor
2378 Points
542 Posts
Re: GuestBook page in Personal website
Jul 27, 2006 09:35 PM|LINK
After viewing the article it is clear that the article was written for ASP.NET 1._
In your code I see your declaring a textbox (name as textbox). In ASP.NET 1._ you needed to do this for server controls that were in your html. In ASP.NET 2.0 you do not need to do this; it is handled for you. If your developing in ASP.NET 2.0, then you should be able to remove all of the following from you code:
Public name As TextBoxPublic location As TextBox
Public email As TextBox
Public website As TextBox
Public comment As TextBox
Public lbName As Label
Public lbLocation As Label
Public lbComment As Label
If you get stuck trying to convert this code, you could use my comments page for my blog as a model for a guestbook. Reviewing the source code for my site, you would need to do the following:
Extended Personal Site Starter kit