I was reading requirements for an online project. it was about asp.net web API. The requirement is one api method /ui/echo/, which echoes any string passed to it as a parameter, which when called, would respond with an UI HTML partial <b>Put echo string here</b>.
I read about RazorMediaTypeFormatter over the internet. Is there any other way web api can return partial views?
I would look to the open source project MvcMailer to see how you could render the Razor View into a string that you could then be put into your response to a REST request. MvcMailer uses Razor Views to render the body of an email as HTML. Since ASP.NET Web API is part of MVC 4 it should integrate well. I have used MvcMailer in MVC 4 projects and it works fine. Look at StringResult.ExecuteResult. That appears to be the meat of the code for rendering a View as a string. Never tried to return HTML in a REST result, and it is usually discouraged. According to this QA you will need to encode the HTML before sending the result back as JSON. There is some good discussion on how to return HTML results here.