Home All Groups Group Topic Archive Search About
Author
12 Oct 2006 7:06 PM
Doug
In VB.NET 2003 I was doing the following(in codebehind)  and it worked great.
In 2005 "WebMain"  in no where in scope.  How do I make "WebMain" visible to
all Code-Behind classes?  Note:  these classes are codebehinds of web pages.

Here's the weird part, I had it work once , then it never worked again.

Public Class WebMain

    Inherits System.Web.UI.Page

    Protected Utilitiess As New Utilities

End Class

Public Class Foo

    Inherits WebMain

End Class

Author
13 Oct 2006 12:17 AM
Scott M.
Where are you creating WebMain?

Is it in your root namespace?  Also, try changing the scope from Public to
Friend.



Show quoteHide quote
"Doug" <D***@discussions.microsoft.com> wrote in message
news:5E00CCD2-B7FB-4C70-9E28-206DE6575FD1@microsoft.com...
> In VB.NET 2003 I was doing the following(in codebehind)  and it worked
> great.
> In 2005 "WebMain"  in no where in scope.  How do I make "WebMain" visible
> to
> all Code-Behind classes?  Note:  these classes are codebehinds of web
> pages.
>
> Here's the weird part, I had it work once , then it never worked again.
>
> Public Class WebMain
>
>    Inherits System.Web.UI.Page
>
>    Protected Utilitiess As New Utilities
>
> End Class
>
> Public Class Foo
>
>    Inherits WebMain
>
> End Class
>
>
>
>
Author
13 Oct 2006 3:30 PM
Doug
It's in the root.  Friend definitely will not work.   I tried moving the
..aspx and the aspx.vb files to app_coode, but that generates ambiguous
referrences and/or 'context' is not defined.

The really sick part is.  I created another page where the class is also
inherited from Webmain, and THAT ONE WORKS!  I see no consistancy whatsoever
with this, as the 2 pages and assiciated classes look identical to me.  So
much for backwards compatability with MS.



Show quoteHide quote
"Scott M." wrote:

> Where are you creating WebMain?
>
> Is it in your root namespace?  Also, try changing the scope from Public to
> Friend.
>
>
>
> "Doug" <D***@discussions.microsoft.com> wrote in message
> news:5E00CCD2-B7FB-4C70-9E28-206DE6575FD1@microsoft.com...
> > In VB.NET 2003 I was doing the following(in codebehind)  and it worked
> > great.
> > In 2005 "WebMain"  in no where in scope.  How do I make "WebMain" visible
> > to
> > all Code-Behind classes?  Note:  these classes are codebehinds of web
> > pages.
> >
> > Here's the weird part, I had it work once , then it never worked again.
> >
> > Public Class WebMain
> >
> >    Inherits System.Web.UI.Page
> >
> >    Protected Utilitiess As New Utilities
> >
> > End Class
> >
> > Public Class Foo
> >
> >    Inherits WebMain
> >
> > End Class
> >
> >
> >
> >
>
>
>
Author
13 Oct 2006 10:46 PM
Mythran
Show quote Hide quote
"Doug" <D***@discussions.microsoft.com> wrote in message
news:63E8F64F-018C-40E2-88D9-2FF43BCC0081@microsoft.com...
> It's in the root.  Friend definitely will not work.   I tried moving the
> .aspx and the aspx.vb files to app_coode, but that generates ambiguous
> referrences and/or 'context' is not defined.
>
> The really sick part is.  I created another page where the class is also
> inherited from Webmain, and THAT ONE WORKS!  I see no consistancy
> whatsoever
> with this, as the 2 pages and assiciated classes look identical to me.  So
> much for backwards compatability with MS.
>
>
>
> "Scott M." wrote:
>
>> Where are you creating WebMain?
>>
>> Is it in your root namespace?  Also, try changing the scope from Public
>> to
>> Friend.
>>
>>
>>
>> "Doug" <D***@discussions.microsoft.com> wrote in message
>> news:5E00CCD2-B7FB-4C70-9E28-206DE6575FD1@microsoft.com...
>> > In VB.NET 2003 I was doing the following(in codebehind)  and it worked
>> > great.
>> > In 2005 "WebMain"  in no where in scope.  How do I make "WebMain"
>> > visible
>> > to
>> > all Code-Behind classes?  Note:  these classes are codebehinds of web
>> > pages.
>> >
>> > Here's the weird part, I had it work once , then it never worked again.
>> >
>> > Public Class WebMain
>> >
>> >    Inherits System.Web.UI.Page
>> >
>> >    Protected Utilitiess As New Utilities
>> >
>> > End Class
>> >
>> > Public Class Foo
>> >
>> >    Inherits WebMain
>> >
>> > End Class
>> >
>> >
>> >
>> >
>>
>>
>>

You may want to look into the VS 2005 Web Application Project download
available from Microsoft.  This makes converting from 2003 to 2005 much much
much much (... get the idea) much much much easier :)

http://weblogs.asp.net/scottgu/archive/2006/05/08/445742.aspx

HTH,
Mythran