I've made sure that the class <T> is the view class by writing out the full namespace :(
PK, are you sure? It's not a matter of namespace. Do you understand the difference between the code-behind class and the ASCX class that doesn't even exist until in-server compilation?
If you write RenderUserControl<My.Project.Namespace.MyViewUserControl>(null, null), it's just going to render a blank, because the code-behind class probably doesn't contain any instructions to render anything.
The only way to make it work is to reference the ASCX class which has a horrible name like RenderUserControl<ASP.views_home_myviewusercontrol_ascx>(null, null).
I'd suggest the RenderUserControl<T> overload should be removed, because this is just going to cause no end of confusion. I can't think of any way it could be easier to use, given that you can have multiple ASCX files "inheriting" the same code-behind class.
SteveSanders...
Member
432 Points
119 Posts
Microsoft
Re: Html.RenderUserControl vs Html.RenderUserControl<T> ?
Mar 18, 2008 08:30 AM|LINK
PK, are you sure? It's not a matter of namespace. Do you understand the difference between the code-behind class and the ASCX class that doesn't even exist until in-server compilation?
If you write RenderUserControl<My.Project.Namespace.MyViewUserControl>(null, null), it's just going to render a blank, because the code-behind class probably doesn't contain any instructions to render anything.
The only way to make it work is to reference the ASCX class which has a horrible name like RenderUserControl<ASP.views_home_myviewusercontrol_ascx>(null, null).
I'd suggest the RenderUserControl<T> overload should be removed, because this is just going to cause no end of confusion. I can't think of any way it could be easier to use, given that you can have multiple ASCX files "inheriting" the same code-behind class.
http://blog.codeville.net/