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 558239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:06:39+00:00 2026-05-13T12:06:39+00:00

I need to render an ASP.NET MVC view to a string so as to

  • 0

I need to render an ASP.NET MVC view to a string so as to be able to send it via an email (it is an order confirmation email defined in an .ascx file ).

I’ve successfully been able to render an ASP.NET MVC View to string using one of the methods in this question.

However now I need to be able to do it via a WCF service (that will be accessed via silverlight) and so I don’t have a ControllerContext. This WCF service is contained within the same project as my MVC project so has access to all my models etc.

I’ve looked at several questions on Stackoverflow about this issue, but they all seem to need a controller context. I thought there was something in mvccontrib but it doesn’t seem to be there anymore.

The closest I’ve found is the accepted answer to the aforementioned question, but it unfortunately breaks with RenderPartial within the view you’re rendering.

I’m hoping maybe some of the behind the scenes work for ASP.NET MVC 2 related to RenderAction may help make this possible now?

  • 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-05-13T12:06:39+00:00Added an answer on May 13, 2026 at 12:06 pm

    The way that the web forms view engine is integrated into MVC requires the controller context as it actually bubbles the templating / rendering up to the ASP.NET Page class which writes the template content directly to the response stream.

    I suggest you take a look at the spark view engine (which will render WFVE templates without change) and use that to generate the templated emails from within the WCF service. There are examples of this in the Spark download.

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

Sidebar

Related Questions

On my asp.net mvc page I need to render multiple images that are stored
I have asp.net mvc application, that uses razor view engine. I want to send
I need to render a partial view to a string within a controller action.
Summary: If you use ASP.NET MVC 2's templates to render a DropDownList, how would
I have a weird need in an ASP.NET MVC 3 application which blocks my
Mine is an asp.net mvc application. I have an index view with rows more
I'm new to ASP.NET MVC, but I need to perform a search for articles
I've created a asp:TreeView control in a ASP.NET MVC Partial View. The view renders
I am working on an ASP.NET MVC application where I need to export data
Updated Question Recently I need to implement a multi step wizard in ASP.NET MVC

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.