Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| 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 March 22nd, 2004, 04:26 PM
Authorized User
 
Join Date: Mar 2004
Location: Benicia, CA, USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default siteprincipal

I am trying to only allow the the Default web page to be viewed by authenticated users. I also want to grab a few of the fields from the Users Details and cutomize the Default page:

I added to the Sub Page_Load
Code:
 If Not (TypeOf Context.User Is SitePrincipal) Then

                Response.Redirect("/ARSurvey/Webmodules/Accounts/Login.aspx")
            Else

                lblGreeting.Text = context.User.Identity.Name
            End If


If I use the check for context.user.identity.isauthenticated check then instead of my is siteprincipal check then I can view the page. The problem comes in when I attempt to pull user details using
Code:
  Dim currentUser As New AccBusiness.User( _
                      CType(Context.User, SitePrincipal))

I get a cast error.

What am I missing, why can I use the CType(context.user.... in the MyAccounts page but when I use it in Default I get a cast error.

I just do can not figure out what I am missing here.

  #2 (permalink)  
Old March 30th, 2004, 06:13 AM
Authorized User
 
Join Date: Mar 2004
Location: , , United Kingdom.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had type casting errors when i when i didnt have the code converting the current context into a siteprincipal object in the PhilePage.vb

 


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
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
HTTPContext + SitePrincipal error (Wiggly Line) eureka BOOK: ASP.NET Website Programming Problem-Design-Solution 3 September 7th, 2004 09:15 PM
error :(SitePrincipal)Context.User yonghoo BOOK: ASP.NET Website Programming Problem-Design-Solution 5 August 5th, 2004 07:30 AM



All times are GMT -4. The time now is 07:00 AM.


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