T
Thierry Schembri
Hello,
I'm facing to a strange problem (framework 2.0).
It's pretty simple : I load a custom web control called "Foo.ascx" (the
control class is "Foo").
Control c = LoadControl("/Foo.ascx");
Up there, it's ok and I can use c the way I want.
Then, I do :
Foo t = (Foo)c;
The following error occurs :
"Unable to cast object of type 'ASP.Foo_ascx' to type 'Foo'.
OK, I modify my line :
ASP.Foo_ascx t = (ASP.Foo_ascx)c;
And now, I get this exception (!!!) :
"Unable to cast object of type 'ASP.Foo_ascx' to type 'ASP.Foo_ascx'".
!!! I break the execution, rebuild the whole stuff and everything works
well now, no more error. But, as soon as I modify something without
rebuild, the exception occurs again (I have to rebuild) !!
Any idea ?
Thanks in advance.
I'm facing to a strange problem (framework 2.0).
It's pretty simple : I load a custom web control called "Foo.ascx" (the
control class is "Foo").
Control c = LoadControl("/Foo.ascx");
Up there, it's ok and I can use c the way I want.
Then, I do :
Foo t = (Foo)c;
The following error occurs :
"Unable to cast object of type 'ASP.Foo_ascx' to type 'Foo'.
OK, I modify my line :
ASP.Foo_ascx t = (ASP.Foo_ascx)c;
And now, I get this exception (!!!) :
"Unable to cast object of type 'ASP.Foo_ascx' to type 'ASP.Foo_ascx'".
!!! I break the execution, rebuild the whole stuff and everything works
well now, no more error. But, as soon as I modify something without
rebuild, the exception occurs again (I have to rebuild) !!
Any idea ?
Thanks in advance.