[1] I guess RenderUserControl<T> fails becase it's instantiating the control's code-behind class (not the subclass defined by the ASCX file), so there'll be nothing for it to render. You could argue that it's expected behavior (since you're supplying T=code-behind-class,
it's your own fault), but lots of people are going to be confused by this.
What do others think - would you call it a bug?
[2] If you supply any values as propertySettings, they'll be applied to any public properties exposed by the control class. Set it to NULL if you don't have any properties you want to set.
SteveSanders...
Member
432 Points
119 Posts
Microsoft
Re: Html.RenderUserControl vs Html.RenderUserControl<T> ?
Mar 17, 2008 10:39 AM|LINK
[1] I guess RenderUserControl<T> fails becase it's instantiating the control's code-behind class (not the subclass defined by the ASCX file), so there'll be nothing for it to render. You could argue that it's expected behavior (since you're supplying T=code-behind-class, it's your own fault), but lots of people are going to be confused by this.
What do others think - would you call it a bug?
[2] If you supply any values as propertySettings, they'll be applied to any public properties exposed by the control class. Set it to NULL if you don't have any properties you want to set.
http://blog.codeville.net/