VS 2005 nightmares

G

Guest

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
 
S

Scott M.

Where are you creating WebMain?

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

Guest

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.
 
M

Mythran

Doug said:
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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top