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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:21:25+00:00 2026-05-31T20:21:25+00:00

I am using jquery modal popup in my application with MVC3 Razor view. Issue

  • 0

I am using jquery modal popup in my application with MVC3 Razor view.

Issue is I need to open popup once I click on Menu Options, these Menu options are there in Layeout page (coz I need to show it throughout the site). As I have to have the popup html code at layeout, so it is appearing as hidden in all page sources.

So is there any better way through which I can create popup html at run time only?

I using this right now:

$(id).dialog({
            closeOnEscape: true,
            draggable: true,
            resizable: false,
            dialogClass: clz,
            modal: true,
            title: $(id + ' .dialog-content').attr('title'),
            closeText: ''
        });
  • 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-31T20:21:27+00:00Added an answer on May 31, 2026 at 8:21 pm

    You can use JQuery UI Dialog plugin and use it to load the modal dialog via ajax

    Example

    $('#MyAtag').click(function () {
    // Add a container for the modal dialog, or get the existing one
    var dialog = ($('#ModalDialog').length > 0) ? $('#ModalDialog') : $('<div id="ModalDialog" style="display:hidden"></div>').appendTo('body');
    // load the data via ajax
    $.get( 'mycontroller/myaction', {},
        function (responseText, textStatus, XMLHttpRequest) {
            dialog.html(responseText);
            dialog.dialog({
                bgiframe: true,
                modal: true,
                width: 940,
                title: 'My Title'
            }); 
        }
    );
    });
    

    which binds a call to an ajax ‘get’ to the ‘click’ event of a link. The ajax get request returns a partial view from the corresponding action in you MVC project, which then shows up in the modal dialog.

    Here is a rough example of what the controller could look like:

    public ActionResult MyAction()
    {
        // Do Some stuff
        //...
    
        // If the request is an ajax one, return the partial view
        if (Request.IsAjaxRequest())
            return PartialView("PartialViewName");
    
        // Else return the normal view
        return View();
    }
    

    Is it what you want ?

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

Sidebar

Related Questions

I am working on razor project where I need to display jquery modal popup.
I'm using jquery for modal dialogs. I want to open model dialog from one
I'm using the jquery ui dialog for a modal popup dialog. It's working great
I'm using the Zurb jQuery Modal script to bring up a popup box. when
I want to create modal popup box using jquery depending on the clicked tr
I'm using FancyBox jquery plugin to display modal popup boxes. The site is: http://www.chatisfying.com
I'm trying to write my own modal popup window using a jQuery function. However,
I am using the jquery simplemodal plugin to popup a modal box and display
I have an MVC3 application doing AJAX edit of a grid line using JQUERY
I am using a jQuery Modal popup script. It can be downloaded from: Modal

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.