Wrox Programmer Forums

Need to download code?

View our list of code downloads.

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 Search this Thread Display Modes
  #1 (permalink)  
Old January 26th, 2007, 01:10 PM
Authorized User
 
Join Date: Sep 2006
Location: Mitcham, London, United Kingdom.
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

  #2 (permalink)  
Old January 26th, 2007, 05:46 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 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.
  #3 (permalink)  
Old January 27th, 2007, 03:53 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 tips
I will start working on it and will let you know when i am done
Cheers
Tawanda

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
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



All times are GMT -4. The time now is 01:22 PM.


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