Wrox Programmer Forums
|
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
 
Old January 26th, 2007, 01:10 PM
Authorized User
 
Join Date: Sep 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete Blog Entries

Hie Guys

How can modify the Blog so that i can be able to delete blog entries when logged in as admin.

I have managed to customize the blog to use the Access Providers instead and it works fine.You can check here http://www.dotnetanatomy.co.uk

Thanks a lot

Tawanda

 
Old January 26th, 2007, 05:46 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Tawanda,

Are there specific areas that you need help with?

In short, this is the pattern you should follow to allow for details:

1. Write a procedure or query, like sprocBlogEntryDeleteSingleItem, that deletes a BlogEntry based on its ID. Similar to sprocBlogEntrySelectSingleItem in terms of parameters.

2. Write a delete method that accepts an ID (an Integer) in the BlogManagerDB class that executes this delete statement and passes in the BlogEntry ID.

3. Write a method in the BlogManager class that accepts an ID and forwards it to the BlogManagerDB class. Wrap the code in a role check, similar to SaveBlogEntry.

4. Add a button to the blog list or detail page. Hide the button when you're not an administrator. This button could be an exact copy of the Edit button / link

5. Write some code in the Click handler that retrieves the ID and then calls the Delete method in the BlogManager class which calls the BlogManagerDB class which in turn fires the query / stored procedure.

Does this help? If not, let me know what areas you need help with.

BTW: nice to see my blog in a real world web site..... Great idea to use the Access providers. They weren't around when we wrote the book. Otherwise, I would have used them, removing the need to write my own security mechanism for Access.

Cheers,

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.
 
Old January 27th, 2007, 03:53 PM
Authorized User
 
Join Date: Sep 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the tips
I will start working on it and will let you know when i am done
Cheers
Tawanda






Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
php/mysql delete button and delete query dungey PHP Databases 17 April 11th, 2009 12:24 PM
Wrox Blog: Viewing individual blog entries Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 May 7th, 2007 12:06 PM
Delete duplicate entries from table expertcalling SQL Server 2000 2 January 2nd, 2005 11:51 PM
how to delete a row when click delete hyperlink naveenkumarg1 Pro JSP 1 August 16th, 2004 01:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.