Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 20th, 2007, 04:28 PM
Authorized User
 
Join Date: Sep 2006
Location: Mitcham, London, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

  #2 (permalink)  
Old April 20th, 2007, 05:01 PM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,033
Thanks: 80
Thanked 1,582 Times in 1,559 Posts
Default

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.
  #3 (permalink)  
Old April 21st, 2007, 06:41 AM
Authorized User
 
Join Date: Sep 2006
Location: Mitcham, London, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #4 (permalink)  
Old April 21st, 2007, 07:11 AM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,033
Thanks: 80
Thanked 1,582 Times in 1,559 Posts
Default

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.
  #5 (permalink)  
Old May 5th, 2007, 05:20 PM
Authorized User
 
Join Date: Sep 2006
Location: Mitcham, London, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #6 (permalink)  
Old May 5th, 2007, 05:32 PM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,033
Thanks: 80
Thanked 1,582 Times in 1,559 Posts
Default

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.
  #7 (permalink)  
Old May 6th, 2007, 06:41 PM
Authorized User
 
Join Date: Sep 2006
Location: Mitcham, London, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #8 (permalink)  
Old May 7th, 2007, 12:06 PM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,033
Thanks: 80
Thanked 1,582 Times in 1,559 Posts
Default

Maybe the BlogEntryId is empty?

Hard to tell without seeing the rest of your code...

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.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 02: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



All times are GMT -4. The time now is 08:10 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.