I have a user control that can show info in a number of different ways.
I do this by having several .ascx files, all of which refer to the same
..cs file.
I can't work out where to put this .cs file so that it will work. The
..ascx files are in the root of the web site, and if I put the .cs file
in there, then the compiler gives me the error "Unable to cast object of
type 'ASP.ShowCategory' to type 'ShowCategory" which I assume means it
can't find the class. If I put the .cs file in the App_Code folder, then
it tells me that is not allowed.
In case it helps, the top of one of the .ascx files looks like...
<%@dotnet.itags.org. Language="C#" Inherits="ShowCategory" ClassName="ShowCategory"
CodeFile="ShowCategory.cs" %
and the top of the .cs file (ignoring "using" statements) looks like...
public partial class ShowCategory : UserControl {
Any ideas? I'm really stuck here. TIA
--
Alan Silver
(anything added below this line is nothing to do with me)Assuming that this would have worked in VS2003, there is a MS kit
available (I'm pretty sure) that let's you create projects in VS2005
just like you would in VS2003. Perhaps it will be part of a service
pack. But it all just makes me sooo confused.
I'll leave it to you to google for it. Or look on msdn.
Alan Silver wrote:
> Hello,
> I have a user control that can show info in a number of different ways.
> I do this by having several .ascx files, all of which refer to the same
> .cs file.
> I can't work out where to put this .cs file so that it will work. The
> .ascx files are in the root of the web site, and if I put the .cs file
> in there, then the compiler gives me the error "Unable to cast object of
> type 'ASP.ShowCategory' to type 'ShowCategory" which I assume means it
> can't find the class. If I put the .cs file in the App_Code folder, then
> it tells me that is not allowed.
> In case it helps, the top of one of the .ascx files looks like...
> <%@. Language="C#" Inherits="ShowCategory" ClassName="ShowCategory"
> CodeFile="ShowCategory.cs" %>
> and the top of the .cs file (ignoring "using" statements) looks like...
> public partial class ShowCategory : UserControl {
> Any ideas? I'm really stuck here. TIA
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
0 comments:
Post a Comment