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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:39:09+00:00 2026-06-04T12:39:09+00:00

I am working with MVC3 c# 4.0. I have created a partial view. I

  • 0

I am working with MVC3 c# 4.0.

I have created a partial view.

I have a button on my page, when I click this button I want to be able to load the partial view in to a modal popup. I presume the best way to do this is via javascript – I am using jQuery already in the application.

Any pointers as to how I could do this?

  • 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-04T12:39:10+00:00Added an answer on June 4, 2026 at 12:39 pm

    You could use jQuery UI dialog.

    So you start by writing a controller:

    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    
        public ActionResult Modal()
        {
            return PartialView();
        }
    }
    

    then a Modal.cshtml partial that will contain the partial markup that you want to display in the modal:

    <div>This is the partial view</div>
    

    and an Index.cshtml view containing the button which will show the partial into a modal when clicked:

    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('.modal').click(function () {
                $('<div/>').appendTo('body').dialog({
                    close: function (event, ui) {
                        dialog.remove();
                    },
                    modal: true
                }).load(this.href, {});
    
                return false;            
            });
        });
    </script>
    
    @Html.ActionLink("show modal", "modal", null, new { @class = "modal" })
    

    Obviously in this example I have put the directly scripts into the Index view but in a real application those scripts will go into separate javascript file.

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

Sidebar

Related Questions

I have been working on ASP.Net MVC3. I created view and controller. Also, I
I am working for asp.net MVC3 Razor view. I have created for dynamically loading
I am working on a MVC3 razor application. I have created a error Handling
I'm working with MVC3 with Razor for first time, and I have a partial
I am working on a blog site, upgrading it to MVC3. I have this
I am working on asp.net MVC 3 application. I have created a Razor view
I'm working on an MVC3 project I have created my database on SQL server
I have created a connectionstring in mvc3 application and it is working fine in
I am working on asp.net MVC3 application and I have created a layout.cshtml which
I have a layout page within that layout I have used a partial view,

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.