Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8347975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:32:53+00:00 2026-06-09T07:32:53+00:00

I was reading requirements for an online project. it was about asp.net web API.

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:32:55+00:00Added an answer on June 9, 2026 at 7:32 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a project with following requirements in mind. data reading intensive application. 100 max
Doing some initial research on a new project and one of my requirements is
My simple requirement: Reading a huge (> a million) line test file (For this
Reading manual about Sling http://sling.apache.org/site/46-line-blog.html added folder blog and blog.html to destination: \launchpad\content\src\main\resources\content\ but
Reading through this excellent article about safe construction techniques by Brain Goetz, I got
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning
Reading some questions here on SO about conversion operators and constructors got me thinking
I was reading about benchmarks and came across these terms. I'm not clear as
I've been reading about Webhooks and I'm trying to determine if it's a specification
I am reading textfile using vb6 code. My requirements are if the line starts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.