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 May 20th, 2004, 02:59 AM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default MyAccount.aspx Error

I use VS.NET 2003 Edition and C#

I tried to complete Phile\Modules\admin\MyAccount.aspx ,but received the following message:

Page Error

--------------------------------------------------------------------------------
An unexpected error has occurred on this page. The system administrators have been notified. Please feel free to contact us with the information surrounding this error.
The error occurred in: http://localhost/Phile/Modules/Users/MyAccount.aspx
Error Message: Can't convert type¡C
--------------------------------------------------------------------------------
Stack Trace:
System.InvalidCastException: Can't convert type¡C at Coolnetboy.Phile.Modules.Users.MyAccount.Page_Load (Object sender, EventArgs e) in d:\inetpub\wwwroot\phile\modules\users\myaccount.a spx.cs:line 50 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()


Source Code:

private void Page_Load(object sender, System.EventArgs e)
        {
            // ¦b³o¸Ì©ñ¸m¨Ï¥ÎªÌµ{¦¡½XÂ¥Hªì©l ¤Ã†ÂºÃ´Â­Â¶
            RoleList.Visible=false;

            if(!Page.IsPostBack)
            {
                DataSet states;
                if(Context.User.Identity.IsAuthenticated)
                {
                    Coolnetboy.WebModules.Accounts.Business.User currentUser =
                        new Coolnetboy.WebModules.Accounts.Business.User( (Coolnetboy.WebModules.Accounts.Business.PhilePrin cipal)Context.User);

                    FirstName.Text=currentUser.FirstName;
                    LastName.Text=currentUser.LastName;

                    states=AccountsTools.GetStates();
                    StateDropDown.DataSource=states;
                    StateDropDown.DataTextField="Description";
                    StateDropDown.DataValueField="StateCode";
                    StateDropDown.DataBind();
                    StateDropDown.SelectedIndex=StateDropDown.Items.In dexOf(StateDropDown.Items.FindByValue(currentUser. State));

                }
            }


Plese help me with this problem.

Thank you.


 
Old June 11th, 2004, 03:07 PM
Registered User
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, you are right.
I use Asp/VB.net to run this project, and get same error. Looks like the type cannot be coverted.

But no author can help us, may be too busy to read ours.
 
Old June 28th, 2004, 01:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

Is this the initial load, or a subsequent load? I've run into the issue of on the second, load, the object reference is dropped, and the original WindowsIdentity (or related object based on security settings) is back.

Brian
 
Old June 8th, 2006, 07:45 PM
Registered User
 
Join Date: Jan 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This isssue occurs while converting from SitePrincipal user to AccBusiness User .. and not due to conversion from Context.user to SitePrincipal.

Isn't more like a design issue of converting from SitePrincipal to user defined AccBusiness user?

Anycase, Did anyone solve this problem yet. Please share your insight. Thanks

Sri

 
Old June 9th, 2006, 11:01 AM
Registered User
 
Join Date: Jan 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Or is this issue resolved in VS2005?

 
Old June 15th, 2006, 05:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I ran my site based on ThePhile for over a year and never saw this kind of problem. You can get my code by looking through the messages here:

http://p2p.wrox.com/topic.asp?TOPIC_...rms=thephileii

You can't easily use ThePhile in VS 2005 unless you also download support for Web Application Projects from MSDN.

Eric





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem: 'Sign Out' on "MyAccount.aspx" reidcor BOOK: ASP.NET Website Programming Problem-Design-Solution 4 April 11th, 2005 11:22 AM
Invalid cast in MyAccount.aspx carinlindberg BOOK: ASP.NET Website Programming Problem-Design-Solution 6 January 15th, 2005 11:49 PM
MyAccount.aspx : can't modify email address Gjerstad BOOK: ASP.NET Website Programming Problem-Design-Solution 5 September 17th, 2003 01:52 PM
exiting MyAccount.aspx robert BOOK: ASP.NET Website Programming Problem-Design-Solution 2 July 17th, 2003 11:23 AM





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