Wrox Programmer Forums
|
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 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 September 5th, 2004, 09:57 AM
Authorized User
 
Join Date: Aug 2004
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default HTTPContext + SitePrincipal error (Wiggly Line)

Hello

I am sure there is a simple explanation to the following errors but as yet it eludes me.

I have looked through the downloaded document and code but I cannot find specific instructions to rectify the problems.

Don't laugh, I have wiggly lines.
Two files with problems:


File: AppException.vb

Public Shared Sub LogError(ByVal message As String)

‘Get the current HTTPContext

Dim context As HttpContext = HttpContext.Current

Wiggly line under HttpContext( Dim context As HttpContext )
Error: HttpContext not defined.
Where and how should it be defined
(I don't see where it is defined in the download code)


File: PhilePage.VB

If Context.User.Itendity.IsAuthenticated Then

If Not (TypeOf context.User Is SitePrincipal)

Dim newUser As New SitePrincipal

Wiggly line under (SitePrincipal)
Error: SitePrincipal not defined.
Where and how should it be defined
 (Can't see where it is defined in the download code)

I am getting frustrated by my lack of progress, every page has an obstruction.

Any help appreciated.
 Thanks


Lynn
__________________
Lynn
 
Old September 7th, 2004, 04:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It sounds like your references aren't right. The most likely cause - you probably didn't migrate the project to VS 2003 correctly. Both the VB.NET and C# code downloads are for VS 2002.

The squiggly lines mean that the datatype isn't known to Visual Studio. The types come from the metadata in DLLs, which are made known through references.

I've covered this in a lot of messages. I wish we could post an updated FAQ for this book.

1) delete all of the .dll and .pdb files
2) open the solution in VS 2003
3) do a rebuild all
4) when you get errors for references you don't have, delete the bad references and set new references to the DLLs you already made

Keep doing steps 3 and 4 until there are no more errors. This will take some time if you don't have much experience with references. When you open the references node in Solution Explorer, you'll see an error symbol by the bad ones.

I recommend only fixing them one-at-a-time, and only when you get an error. Don't delete all of the bad references at once because then you won't know which references you need. You need to replace each one you delete, or else you'll be in trouble!

Eric
 
Old September 7th, 2004, 05:39 PM
Authorized User
 
Join Date: Aug 2004
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Eric,

Thanks for your detailed replay.

 I was puzzled as to why the wiggly lines occurred on both the original download version as well as the project I am trying to create, especially as I have not altered any of the download code. I expect as you suggest the project has not migrated correctly I am using VS.net 2003 and I am copying the original code.

I will have a go at your suggested solution. As you might have guessed I am not very experienced yet, so it probably will take me a little time, but as least I know what the problem might be.

I thought I was going nuts I went over and over the code in case I had made a typo error.

Eric are you in the cavalry or wear shiny armour and ride a white horse? You always seem to turn up just in time to save the day and in this case my sanity.

Thanks for your help.

I would like to offer you a drink but it seems to makes my computer act strange.

Did I say I still had my sanity?

Lynn
 
Old September 7th, 2004, 09:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is a difficult project for someone starting out. It's hard for people to make the jump from very simple pages to a project like this.

You might want to try making more demo projects to give you experience. I like to point people to www.codeproject.com for a lot of good demo projects and writeups. Get a free account there and look at their ASP.NET projects.

Eric





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error - context As HttpContext not defined netasp BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 28th, 2005 11:34 PM
SitePrincipal JsonTerre1 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 29th, 2004 06:05 PM
(SitePrincipal)Context.User Philey BOOK: ASP.NET Website Programming Problem-Design-Solution 3 October 8th, 2004 05:38 PM
error :(SitePrincipal)Context.User yonghoo BOOK: ASP.NET Website Programming Problem-Design-Solution 5 August 5th, 2004 07:30 AM
siteprincipal fzilz BOOK: ASP.NET Website Programming Problem-Design-Solution 1 March 30th, 2004 06:13 AM





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