Cannot reference page classes

  • Thread starter Kevin Lawrence via .NET 247
  • Start date
K

Kevin Lawrence via .NET 247

Hi

I'm using Beta 2, I haven't tried Beta 1 yet so I'm not sure if that's relevent.

Why can't I reference my WebForm classes?

For example I want to put a static method on a WebForm class so that I can pass an argument to it, however I can only reference certain classes in the ASP namespace.

Why is this? Sorry if I haven't explained too well.
 
B

Brock Allen

This isn't encouraged as it's probabaly not the right way to go about doing
whatever you're trying to do. If you want shared code to be used by many
pages, then you should factor that out into a seperate class. You can create
classes in the App_Code directory and those will automatically be compiled
for you in ASP.NET (and referenced) so you can use that common code by any
page.

What exactly are you trying to do in the common code that you want to put
in a ASPX file?
 

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

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top