 |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
 | This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 20th, 2007, 04:28 PM
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Wrox Blog: Viewing individual blog entries
Hie
I am tryingto add functionalityto the wrox blog so that individual blog entries can be viewed seperatly and user can post comments.
How do i go about it.
Thanks
Tawanda
|

April 20th, 2007, 05:01 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Tawanda,
Here's what I would do:
1. Add an hyperlink to each blog entry in the list of blogs that points to ViewBlogDetails.aspx. Pass the ID of the blog entry in the query string.
2. On the (new) page ViewBlogDetails.aspx, get the ID from the querystring, call GetBlogEntry and pass it the ID. Then use the BlogEntry object to fill controls on the page, like labels for the Title and Body.
3. Adding comments would be similar; you already have the blog entry in the page, so it should be easy to add a new comment and pass it the ID of the blog entry, the user's name and comment.
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|

April 21st, 2007, 06:41 AM
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hie
Thanks for the reply.
I was kind of wary about the idea of creating a new page and thot there could be a way of using a user control but the problem i had was on how to pass the blogEntryId from one user control to the other.
ie when user clicks the title in blogEntries.ascx, the blogEntryId is passed to blogEntryDetails.ascx which will display the details.
hope this makes sense
thanks
|

April 21st, 2007, 07:11 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Did you check out the Modifications folder for the Wrox Blog application that comes with the book?
It shows you how to allow a visitor to add comments by clicking the Add Comment LinkButton. On the click of that button, the AddComment command is triggered. Right now, the code in dlBlogEntries_ItemCommand just shows the Comments panel, but it would be easy to show the blog data itself as well. And to allow a user to go to that detail page, you can wrap the <h3> or <h2> with the blog's title in a LinkButton as well.
Does that help?
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|

May 5th, 2007, 05:20 PM
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks a lot,ive looked at the Modifications folder on companion CD.
The problem i am now having is to do with inserting comments into Access database.
I am getting a "Data type mismatch in criteria expression." Error
and not sure how to work around it.
Ive checked the data type of fields in table and the values being passed to be inserted and there shouldnt be a conflict.
The SQL stats are as follows:
INSERT INTO BlogFeedback ( PostersName, Body, BlogEntryId )
VALUES (  ,  ,  );
Is there any way i can get around this error.
Thanks in advance
Tawanda
|

May 5th, 2007, 05:32 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Since PostersName and Body are strings, you need to enclose them in quotes:
Code:
INSERT INTO BlogFeedback ( PostersName, Body, BlogEntryId )
VALUES ('[ ? ]', '[ ? ]', [ ? ]);
HtH,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|

May 6th, 2007, 06:41 PM
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for the response but unfortunately i am still getting the error.
Ive put character data into ' ' quotes as you said.
Is there anaything else that could be causing the error i could look at.
Cheers
|
Similar Threads
|
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
Wrox Blog in C# |
madAlan |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 |
22 |
June 12th, 2011 04:09 AM |
Wrox Blog |
tblessed23 |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 |
16 |
May 14th, 2007 04:08 PM |
Delete Blog Entries |
Tawanda |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 |
2 |
January 27th, 2007 03:53 PM |
Wrox blog suggestions |
nakori |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 |
3 |
June 15th, 2006 04:35 PM |
FCKeditor in wrox blog |
nakori |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 |
5 |
June 11th, 2006 02:48 AM |
|
 |