Casting user controls

G

Guest

Has anyone else experinced major issues with the model ASP.NET 2.0 uses for
user controls? When I attempt to cast a dynamically loaded user control (or
master page, for that matter), like the following:

Dim article As App_Controls_ctlArticleDetail =
Page.LoadControl("~/App_Controls/ctlArticleDetail.ascx")

It will work occasionally, but as I make updates to other controls
page-behind files in the application, I get errors like:

Compiler Error Message: BC30554: 'App_Controls_ctlArticleDetail' is ambiguous.

or

"Unable to cast to object of type [insert master type here] to type [master
page type here]"

If I rebuild the app, it seems to work... What the heck is the problem? Am I
not understanding the ASP.NET 2.0 compilation model correctly?

Thanx
 

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