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 October 25th, 2006, 07:50 AM
Authorized User
 
Join Date: Jun 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Merging blog application into existing web

I am having difficulties in getting the blog application to work within my existing website that already has its own separate login controls linking to a separate database for authentication. (I am using access db in both cases)

The problem is that I can view the blog entries in default.aspx, but I cannot login(for a second time, after having already logged in to my site) to edit/add to my existing blog entries.

I am still only running this on my development PC (using VWD express).
I can therefore run the default.aspx containing the blog controls directly. I can attempt to login with the administrator password (as given in the book's erratum)but nothing appears to happen - not even an error message stating the incorrect login details have been entered.

Being a relative beginner I must be creating some sort of conflict in trying to have two authentication processes running at the same time. Can any one guide me through the likely pitfalls in doing this?

I have the blog application in its own sub folder from the root called 22blog. The contents of the web.config file that came with the sample is commented out at present. I have included the lines specific to the blog application in my existing web.config in the root.

Thanks


 
Old October 25th, 2006, 12:03 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 Insel,

If you incorporate the blog in an existing site, you can drop the authentication from the Blog, and use the one from the parent site.

So, delete the stuff for Membership and Roles from the web.config file. Also remove the authentication element from that file. That way, the Blog is just another folder in your app.

Then make sure you have a role called Administrator in your own database. Once you log in with an account in that role, you should be able to add new entries.

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
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 October 25th, 2006, 01:10 PM
Authorized User
 
Join Date: Jun 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Imar,

Yes that has done the trick. Many Thanks for your help.

I intended to use the blog to publicise up coming events in our church. Other than "manually" editing the underlying database in MS Access, is there a realtively straight forward way to create a page that deletes blog entries?

BTW I am really finding your "book asp.net instant results" very helpful.

Regards

Insel Haber

 
Old October 25th, 2006, 03:54 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 Insel,

Glad you like the book. Spread the word, spread the word... ;)

Anyway, deleting an item shouldn't be too hard. Similar to how the EditCommand is used in BlogEntries.ascx, you can hook into the DeleteCommand as well, like this:
Code:
Protected Sub dlBlogEntries_DeleteCommand(ByVal source As Object, _
     ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) _
     Handles dlBlogEntries.DeleteCommand
  ' Write delete code here
End Sub
Inside this event handler, get the ID of the item being edited which you can then pass to a method like DeleteBlogEntry in the BlogManager class.

This method could look similar to GetGetBlogEntry, in that you pass a single BlogEntryId to it. Inside the method, you should fire a SQL delete statement (e.g. DELETE FROM Blog WHERE Id = @id) to delete the item.

Don't forget to delete related comments first, when you're using the comment feature.

Hope this gives you some ideas.

Imar
---------------------------------------
Imar Spaanjaars
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 October 26th, 2006, 02:11 PM
Authorized User
 
Join Date: Jun 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar

Regards
Insel Haber






Similar Threads
Thread Thread Starter Forum Replies Last Post
Blog - Web.Config Settings for Access Database kanzeon4 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 April 5th, 2008 07:46 AM
Re.BlOG Web site arumugan Ajax 1 February 18th, 2008 09:45 AM
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
Problem with an existing application davidrodrigues40 ASP.NET 2.0 Professional 2 March 22nd, 2007 10:13 AM
Blog application: Is this an Error in application yousaid BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 31 February 7th, 2007 02:57 PM





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