Registering custom webcontrol inside mvc view?
Posted
by kastermester
on Stack Overflow
See other posts from Stack Overflow
or by kastermester
Published on 2009-01-05T13:23:02Z
Indexed on
2010/04/09
2:03 UTC
Read the original article
Hit count: 397
I am in the middle of a project where I am migrating some code for a website from WebForms to MVC - unfortunatly there's not enough time to do it all at once, so I will have to do some... not so pretty solutions.
I am though facing a problems with a custom control I have written that inherits from the standard GridView control
namespace Controls {
public class MyGridView : GridView { ... }
}
I have added to the web.config file as usual:
<configuration>
...
<system.web>
...
<pages>
...
<controls>
...
<add tagPrefix="Xui" namespace="Controls"/>
</controls>
</pages>
</system.web>
</configuration>
Then on the MVC View:
<Xui:MyGridView ID="GridView1" runat="server" ...>...</Xui:MyGgridView>
However I am getting a parser error stating that the control cannot be found. I am suspecting this has to do with the mix up of MVC and WebForms, however I am/was under the impression that such mixup should be possible, is there any kind of tweak for this? I realise this solution is far from ideal, however there's no time to "do the right thing".
Thanks
© Stack Overflow or respective owner