Web Form Fails To Load in VS.NET w/ sample code

I have a BasePage class and a StandardPage class.

The BasePage inherits from the System.Web.UI.Page object, and then the StandardPage inherits from BasePage.
System.Web.UI.Page
|
|
BasePage
|
|
StandardPage

The BasePage has some Properties that access the Request object.
Now I have an 'index.aspx' page with no codebehind and inherits the 'StandardPage' object through the PageDirective tags. When I try to view the 'index.aspx' in the designer, it breaks saying "accessor fails... Request has no instance' (Something like that)
Anyway when I comment out the Request object, the page loads in the designer perfectly. During runtime the page loads perfectly too...the problem only comes during design time.
Sample code can be found @
http://www.dotnet247.com/247reference/msgs/10/53940.aspx
This guy has the exact same problem.

0
yoshijg
1/13/2005 1:46:06 PM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 6 followers.

💬 4 Replies
👁️‍🗨️ 1024 Views



Are you saying that you do not want a code behind? You want to use inline code instead?
If so, what does your @Page directive look like?

Jamie Kindred, CGA, MCSD
0
NetProfit
1/13/2005 2:25:58 PM
No inline code in aspx files.

I dont want to tie an aspx file to a codebehind.
The aspx file will chose who it wants to inherit from. This way I can have multiple views for one Page model object (MVC).
Page tags will look like ...
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Web.StandardPage"%>

By the way, the problem I stated is resolved in "VS.Net 2003".
Just post-back if you still want to continue the topic and my purpose with the Page-Directive.
peace



0
yoshijg
1/13/2005 4:09:44 PM
Good news.

I understand what you are doing, I wasn't sure why it wasn't working in the designer. So you're saying this is an issue with v2002?
Cheers,
Jamie Kindred, CGA, MCSD
0
NetProfit
1/13/2005 7:59:34 PM
yep.  

I ran the same code and aspx file in vs2003...and it loaded fine.
In 2002 the Property in the Base Class are accessed, and for some reason the HTTPCONTEXT is Nothing. So all those Page/Response/Request calls crash when they are in Properties.
So the other solution to this is checking with 'if HttpContext is nothing' . This is a hacky solution, but it works if you dont want to use 2003.
cheers.
0
yoshijg
1/13/2005 8:46:39 PM
Reply: