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 March 2nd, 2005, 06:28 AM
DM2 DM2 is offline
Registered User
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Typing problem with the Phile

I have searched the forum for answer to my problem some sound similar but are not the same, my problem is: (I know this looks a bit long but bear with me!!)

E.g Using MyAccount.aspx (vb version)

When i first built the solution the page ran with out a problem after modifying the site a bit and rebuilding a few times I am getting 'Specified cast is not valid.' When I try to submit changes on MyAccount.aspx.

I understand that PhilePage is Inherited and this types Context.user as the SitePrincipal, which works fine when I first go to MyAccount.aspx (not postback), but fails when I submit.

I put a break point in PhilePage.vb in the Load sub, when I first got to MyAccount.aspx the breakpoint is hit, and context.user is initialized and all is fine. On submit though the breakpoint is not hit and the code fails with the (very annoying!) 'Specified cast is not valid.'

The only way I can solve this is by copying the PhilePage page_load code into top of MyAccount.aspx Page_load.

Has anyone got any suggestions as to why this happens or how I can fix it??
 
Old May 5th, 2005, 06:34 AM
Registered User
 
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DM2, I am also using the VB version and typing along. Did you find a solution to this problem?

 
Old May 5th, 2005, 07:21 AM
DM2 DM2 is offline
Registered User
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, I am still getting round the problem by doing what I mentioned at the bottom of my first post. :(



 
Old May 6th, 2005, 06:39 PM
Registered User
 
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks DM2. I'll try your workaround and if I figure out a solution I'll be sure to post here and let you know.

:-)

 
Old May 11th, 2005, 05:52 AM
Registered User
 
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DM2, I have also managed to get around this problem by placing a call to MyBase.PhilePage_Load(sender, e) at the start of each page's page_load. This is required because the PhilePage_Load method is firing *after* current page's page_load.

Whilest running the downloaded code of ThePhile with the debugger, I noticed that their PhilePage_Load method is firing *first*. Is there some project/imports/init/etc. setting that would specify that the inherited page's page_load event should fire first?

I think that if we could figure this out, then our problem disappears!
 
Old May 11th, 2005, 06:21 AM
Registered User
 
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey DM2, when you get a chance, can you try the following.

In your PhilePage class, change the following line from:

Private Sub PhilePage_Load(ByVal sender As Object, ByVal e As EventArgs)

to

Protected Sub PhilePage_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load

Then comment out the copied in code in say, your MyAccount.aspx.vb file, compile and run and see if it works for you!

/Whoa. Weird formatting!





Similar Threads
Thread Thread Starter Forum Replies Last Post
need some help with typing narmer93 Visual Studio 2005 1 May 20th, 2008 05:28 AM
The Phile II - updates and mods englere BOOK: ASP.NET Website Programming Problem-Design-Solution 19 December 21st, 2005 02:37 PM
a problem with textbox typing, thanks! raybristol ASP.NET 1.0 and 1.1 Basics 2 December 16th, 2005 06:02 PM
Please help,the phile web is not support chinese jld666888 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 December 13th, 2005 09:59 PM
Can't start the Phile sample web application kuotaiyi BOOK: ASP.NET Website Programming Problem-Design-Solution 1 June 12th, 2003 10:29 PM





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