Wrox Programmer Forums
| 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 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 May 24th, 2004, 05:49 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Subclassing system.web.ui.page

Has anyone found the definitive answer the question regarding the load order and the site principal issues when using visual studio.net and vb.net

I has seen many posts but do final answer from anyone.

 
Old May 24th, 2004, 03:44 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

Visual Studio.net is the Package which contain
Vb.net
C#
VisualC.net
and others

Ahmed Ali
Software Developer
 
Old May 25th, 2004, 10:02 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I know what visual basic is that wasn't even the question.

here is the fix for the problem i found, and it works

If you want to avoid having to put the line "base.PhilePage_Load(sender, e) in your derived page's On_Load event, then instead take the code for replacing the context.user with the custom SitePrincipal object out of the PhilePage_Load method, and create a new method in the base page such as PhilePage_LoadUser. Then, in the base page OnInit method, change it to read:



protected override void OnInit(EventArgs e)

{

    base.OnInit(e);

    this.PhilePage_LoadUser();

    this.Error += new System.EventHandler(this.PhilePage_Error);

}




Now your derived page will execute and you can use the code in MyAccount.aspx exactly as is, and it will correctly pull the role info from the SitePrincipal and display it without any errors about invalid casts.

Woo hoo!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobile Control in System.Web.UI.Page hpfarstad ASP.NET 2.0 Professional 0 August 28th, 2006 05:00 AM
access information from a datalist System.Web.UI.I kristian1977 ASP.NET 2.0 Basics 0 July 21st, 2006 08:28 AM
No System.Web.UI alexanderH BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 10th, 2005 03:04 AM
namespace System.Web.UI henninga BOOK: ASP.NET Website Programming Problem-Design-Solution 9 November 16th, 2004 03:51 PM





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