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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:22:52+00:00 2026-05-15T12:22:52+00:00

In MVC .NET application we can easily use PartialView to print the output of

  • 0

In MVC .NET application we can easily use PartialView to print the output of an ASCX file.

For example, I have Book.ascx file, I could have this in the controller

public ActionResult Book(int id)
{
  BookModel model = new BookModel() { bookId = id };
  return PartialView("Book", model);
}

which returns the output of Book.ascx

Is there any way we can do this in a normal .NET website?

I want to be able to use it with AJAX, eg.
When an Update button is clicked, replace the content of <div id="book123"> with the output of /Book.ascx?id=123

Is that possible?

I am looking for something like this

$.get('Book.ascx?id=123', function(data) {
  $("#book123").html(data);
});

But that won’t work because you can’t call Book.ascx directly…

Thanks in advance

  • 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-15T12:22:53+00:00Added an answer on May 15, 2026 at 12:22 pm

    well, it is doable, but not pretty 🙂

    you could instantiate your control, and instead of passing the key via QueryString, do it via exposed property:

    var ctrl = new BookModel();
    ctrl.BookID = "book123";
    

    than you could render the HTML out of it with something like

    private string renderControl(Control ctrl)
    {
      System.Text.StringBuilder sb = new System.Text.StringBuilder();
      System.IO.StringWriter tw = new System.IO.StringWriter(sb);
      System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
      ctrl.RenderControl(hw);
      return sb.ToString();
    }
    

    than you would pass that html back via your service and insert into the div etc..

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

Sidebar

Related Questions

Today i test my ASP.NET MVC web-application and i find out anyone can easily
I'd like to implement ASP.Net MVC application which could have controllers, views and content
I want to outsource the design of my Asp.Net Mvc web application. How can
how can i run code when an application ends with asp.net mvc ?
In my ASP .NET MVC application i have a link that refreshes the preview
In my ASP.NET MVC application, I have the following setup: <runtime> <assemblyBinding xmlns=urn:schemas-microsoft-com:asm.v1> <probing
I currently have a web application written by ASP.NET MVC. Now I want to
I believe you can pre compile a asp.net mvc application but there are some
I have a ASP.NET MVC web application that is supposed to be sold in
I have a MVC .NET application that I would like to expose to our

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.