Nested Masters, User Controls, and VS2005

D

daveh551

Okay, another problem I'm having with nested master pages on VS 2005.

I've got a MasterPage,master, as SubMaster.master, and a
DesignTime.master, and a content page, default.aspx.

The DesignTime master is a single level master page incorporating both
the content of the MasterPage and the SubMaster, so that I can get
around the fact that you can't see content pages in Design mode if
they use nested masters.

And, of course, you can't see the content of the SubMaster in design
mode at all.

I've created a User Web Control, CategoryList.ascx, which incorporates
a drop downlist, a GridView, and a DataSource.

I can drag that UserControl on to my DesignTime.master file (in design
view), and into my default.aspx file in design view, and both of them
build just fine. But when I go into either of them in source view and
copy and paste the line of code into SubMaster.master (since I can't
open it in Design View), I get an error.

The markup that is generated when I drag the User Control is
"<uc1:CategoryList ID="CategoryList1" runat="server" />"

When I cut and paste that markup in SubMaster.master, I immediately
get an error displayed "Unrecognized tag prefix or device filter
'uc1'" That's without even attempting to build it. (When I try to
build it, it also adds "Unknown server tag 'uc1:CategoryList'.")

Is there anyway around this?
 
D

daveh551

Okay, another problem I'm having with nested master pages on VS 2005.

I've got a MasterPage,master, as SubMaster.master, and a
DesignTime.master, and a content page, default.aspx.

The DesignTime master is a single level master page incorporating both
the content of the MasterPage and the SubMaster, so that I can get
around the fact that you can't see content pages in Design mode if
they use nested masters.

And, of course, you can't see the content of the SubMaster in design
mode at all.

I've created a User Web Control, CategoryList.ascx, which incorporates
a drop downlist, a GridView, and a DataSource.

I can drag that UserControl on to my DesignTime.master file (in design
view), and into my default.aspx file in design view, and both of them
build just fine. But when I go into either of them in source view and
copy and paste the line of code into SubMaster.master (since I can't
open it in Design View), I get an error.

The markup that is generated when I drag the User Control is
"<uc1:CategoryList ID="CategoryList1" runat="server" />"

When I cut and paste that markup in SubMaster.master, I immediately
get an error displayed "Unrecognized tag prefix or device filter
'uc1'" That's without even attempting to build it. (When I try to
build it, it also adds "Unknown server tag 'uc1:CategoryList'.")

Is there anyway around this?

Sorry for the bandwidth. I found the answer. I copied the markup
code from the body of the page, but I didn't know about the @Register
directive at the top, so I wasn't copying it. Once I did, it worked
fine.
 

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