Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: ASP.NET Website Programming Problem-Design-Solution
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 15th, 2005, 11:33 AM
Registered User
 
Join Date: Jan 2005
Location: Maidenhead, , United Kingdom.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default NAMESPACE & REFERENCING PROBLEM WHEN REBUILDING

I am trying to pull the book's solution code into a new solution I have created from scratch. I am working through each part of the book but a namespace problem is getting in the way.

I have renamed a number of namespaces within the project:
E.g. in "Controls\SiteHeader.ascx.cs" I have renamed
> Wrox.WebModules.Accounts.Business;
to
> ForHotels.WebModules.Accounts.Business;

The problem is that the namespace "Business" in "ForHotels.WebModules.Accounts.Business" is not being picked up despite being viewable & searchable both via the Object browser and Class viewer in VS.NET.

I have already done the following:
1) Emptied the "bin" folder in each Project
2) Re-referenced each Project using right click "Add Reference"
3) Re-built the Solution

Can anyone help with some ideas? Would be appreciated as I have been working on this for 5 hours!

Cheers,

3Moose.


  #2 (permalink)  
Old January 15th, 2005, 11:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How do you know it's not being picked up? Are you sure that's what the error is saying?

Eric
  #3 (permalink)  
Old January 16th, 2005, 07:02 AM
Registered User
 
Join Date: Jan 2005
Location: Maidenhead, , United Kingdom.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When debugging, there is a squiggly blue line under each namespace.

However, I have since found that this problem was because I had not kept the filestructure of the original application when recreating the project in VS.NET (for a variety of reasons which I won't clarify).

I recreated the structure e.g. ACCOUNTSBUSINESS and the Module/Users reside in the same PHYSICAL directory and must do so... when they do then the namespaces work.

The issue then becomes a whole series of other errors that have led me to give up with simply importing projects. A warning to others is that unless you are happy to use the source verbatim, trying to get it work with your application by copying is a slippery and time consuming process. I think it is because this approach is probably not how one should go about building web projects VS.NET.

QUESTION: If I wanted to import just the User Accounts module into a new Solution (which is essentially what I would like to do), what would be the main things I should do/look out for (top line, best practice approach)?

Please note for anyone trawling this for solutions in the future - I come at this as a hobbyist programmer with a stronger design background!

  #4 (permalink)  
Old January 16th, 2005, 11:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

>When debugging, there is a squiggly blue line under each namespace.

I assume you mean in the code editor. That means it can't find your namespace in any of the currently referenced DLL's. You need to have a reference to a DLL in order to use any of it's objects.

>I recreated the structure e.g. ACCOUNTSBUSINESS and the Module/Users
> reside in the same PHYSICAL directory and must do so... when they do
>then the namespaces work.

You're making a mistake somewhere. Foldernames are NOT tied to namespaces. We pick foldernames to make it easier for us to manage our own files.

The big question is: what DLL's did you reference? This brings in the metadata and lets you use those objects. No reference, and you'll get a squiggly line, and the compile will blow up.

>If I wanted to import just the User Accounts module into a new Solution
>(which is essentially what I would like to do)...

Wow - you picked the hardest module to use in another project. That module relates to the security underpinnings, including the base page all user pages inherit from.

Do you need a public area of you site, and then a separate area where people have to log in? Or, do you want all your users logged in?

You should do some research on user authentication and authorization in ASP.NET. I don't think you really want to use ThePhile if the only module of interest to you is the User module. That's a little like buying a new car because you want to use it's engine in another car you have lying around. It would be easy to take the radio and put it in another car, but moving the engine is a lot of work!

Eric
  #5 (permalink)  
Old January 16th, 2005, 12:16 PM
Registered User
 
Join Date: Jan 2005
Location: Maidenhead, , United Kingdom.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the response. I found that the best way to work around it was to take a copy of the files I needed from the book's code and drop them into the web folder where my project resides. Having done that, I then added them as projects into my web project and the namespace problems disappeared.

I don't really know if that is best practice or if it was just, plain obvious but it makes sense to the way my mind works! :-)

Eric thanks for your help... I have seen a number of your posts and your time and effort is appreciated.

 


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
Problem with table referencing to itself VerbatimBOT SQL Server 2000 3 May 22nd, 2007 04:53 AM
Problem with the namespace & classes ayamas .NET Framework 2.0 2 November 25th, 2006 02:13 PM
Problems with namespace & classes ayamas Visual Studio 2005 0 October 12th, 2006 08:56 AM
rebuilding wrox.thephile.dll RickDagger BOOK: ASP.NET Website Programming Problem-Design-Solution 2 September 27th, 2005 01:30 PM
Image Referencing Problem Ben Horne HTML Code Clinic 2 October 21st, 2003 09:10 AM



All times are GMT -4. The time now is 02:59 PM.


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