Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm just starting out in asp.net 2.0 and finding out alot of things have changed. Alot of things.

Anyway I'm writing a website that has a main default page with a few divs for header and nivigation and whatnot. Then I make user controls and swap them in the middle pane. Real simple like. In VS03 I would have all of my pages in a namespace and then things like data tier access in another namespace for neatness. But now when I generate a control in 2.0 I don't get a namespace attirbute on the top, instead I get a partial class. When I try to add the namespace in the code behind I get an error about the partial class name not jiving with the inherits tag and maybe I'm not doing something correctly

 

Error	1	Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl)

 

Can I no longer have namespaces like I used to?

Wanna-Be C# Superstar
  • Administrators
Posted

If you look at the html in the aspx file, at the top there should be an @Page directive, find the inherits=".." attribute and modify this so it also includes the namespace.

 

Then again if you are using 2005 have you considered moving to a masterpage form of layout - will make a easier solution than usercontrols for this kind of thing.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...