tags:

views:

98

answers:

1

This may be a rookie question but if I have created a suite of user controls in MVC, can I reuse them in non MVC projects?

The reason I ask is because where I work we have multiple projects and not all of them can or will be converted but I'd like to show the powers that be that anything I do in MVC, with user controls, can be reused in other areas of the business.

+1  A: 

Hi

It's a bit difficult because ASP.NET doesn't use the same technic to render the controls on the page.

If your MVC control on generate html markup and isn't strongly bind to a particular model, the best I can see is to wrap your mvc control into an ASP.NET HtmlGenericControl and initialise the InnerHtml value with the Html string returned by your MVC control.

I hope it will help.

mberube.Net
+1 Yeah I'm right with you hence the question. I was hoping I could inherit from X and get it to work. I don't much like the idea of a wrapper for a generic control as it complicates the model and reusability somewhat.
griegs