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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:47:48+00:00 2026-05-19T13:47:48+00:00

I am a completely new to mvc and trying to create a dummy application

  • 0

I am a completely new to mvc and trying to create a dummy application to learn mvc 3.
I have worked my way through the music store example and now I am trying to extend it slightly into a more real world application.
With the example whenever you want to any new item you are redirected to the Create view which is fine however I want instead of doing a full page post back I want to use the jquery.dialog to open a modal popup which will allow the user to insert a new item.

so far I have

  <script type="text/javascript">

    $(function () {

        $('#dialog').dialog({
            autoOpen: false,
            width: 400,
            resizable: false,
            title: "hi there",
            modal: true,
            buttons: {
                "Close": function () {
                    $(this).dialog("close");
                }
            }
        });
        $('#my-button').click(function () {
        $('#dialog').dialog('open');
        });}); </script>

     <div id="dialog" title="Create Album" style="overflow: hidden;">
    @Html.Partial("_CreateAlbumPartial")</div>

Problems with this is the partial view is loaded everytime not through ajax and I dont really know where I should be placing the partial view. Shoukld it be in the shared location or in the folder with the other views?
How do I update the controller class to cater for the partial view?

Sorry if these are easy to do, im 3 days into mvc 🙂

  • 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-19T13:47:49+00:00Added an answer on May 19, 2026 at 1:47 pm

    Try something like this:

    <script type="text/javascript">
        $(function () {
            $('#dialog').dialog({
                autoOpen: false,
                width: 400,
                resizable: false,
                title: 'hi there',
                modal: true,
                open: function(event, ui) {
                    //Load the CreateAlbumPartial action which will return 
                    // the partial view _CreateAlbumPartial
                    $(this).load("@Url.Action("CreateAlbumPartial")");
                },
                buttons: {
                    "Close": function () {
                        $(this).dialog("close");
                    }
                }
            });
    
            $('#my-button').click(function () {
                $('#dialog').dialog('open');
            });
        });
    </script>
    <div id="dialog" title="Create Album" style="overflow: hidden;">
    

    We used the open function which is triggered when the dialog is opened and inside we send an AJAX request to a controller action which would return the partial:

    public ActionResult CreateAlbumPartial()
    {
        return View("_CreateAlbumPartial");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to the MVC pattern but have been trying to grasp it, for
I'm new to MVC, but I've been all over this, read all the documentation
I am trying to create a partial view I call ImageViewer. It will be
I'm trying to verify the behaviour of my ASP.Net MVC app when an unexpected
I'm currently trying to user actionlink helpers in a way that I don't think
I am currently starting a new ASP.NET MVC Project at work where we need
I am trying to build an uploader with ASP.NET MVC, but I'm having a
I have a best practice question. I'm developing a OO MVC framework in PHP,
I have a partial view that inherits from ViewUserControl<Guid?> - i.e. it's model is
I want to output two different views (one as a string that will be

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.