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 June 15th, 2007, 12:47 PM
Authorized User
 
Join Date: Jan 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete Button not working in Wrox CMS VB

I've installed the CMS Project from the CD on my machine and opened it up in VS 2005. When taking the application for a "test drive" I noticed that I can add content just fine but if I click the delete button to delete content from the content list, I get the "Are you sure..." message but when I press OK nothing gets deleted.

What do I need to do to fix this problem?
 
Old June 15th, 2007, 01:22 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 there,

This issue has been reported before, and is described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=45586

The solution I am presenting is a little verbose though; it's easier to change the code in ContentList.aspx.vb around line 32 to:

' Delete button found; add a confirmation dialog
deleteButton.Attributes.Add("onclick", "if (!confirm('Are you sure you want to delete this content item?')) return false;")

Notice how the code only returns something when the user clicks Cancel. Previously, by returning true when you clicked OK, the default postback handler isn't triggered anymore.

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.
 
Old June 15th, 2007, 03:44 PM
Authorized User
 
Join Date: Jan 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Gracias! I knew it had to be something simple.

 
Old June 16th, 2007, 03:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome.

BTW, instead of

deleteButton.Attributes.Add("onclick", ....

you could also use OnClientClick:

deleteButton.OnClientClick = ....

Same effect, but makes the code a bit more readable.

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
C# Wrox CMS Code jminatel BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 June 3rd, 2009 04:41 AM
Wrox CMS in2minds BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 October 15th, 2008 04:14 PM
Wrox CMS in C# .Netster BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 10 February 26th, 2007 04:56 PM
Wrox CMS Deletions retroviz BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 9 February 3rd, 2007 04:55 AM
Wrox CMS retroviz BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 January 31st, 2007 01:23 PM





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