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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:28:23+00:00 2026-05-26T07:28:23+00:00

I am creating a website using MVC3/C#/ASP.NET which contains a view page that will

  • 0

I am creating a website using MVC3/C#/ASP.NET which contains a view page that will show a JQuery Modal type popup (the implementation is a bit different than a traditional modal window, but the functionality is quite similar). Currently I have the markup that will go into the modal window stored as a partial view (with a separate associated model).

I was doing a little research on JQuery modal windows, and it seems a lot of the examples I am seeing online are using a single view with a hidden div, and the modal window is just populated with the markup from inside the hidden div. In these examples there is only one view (the main view for the page), and the model data behind the hidden div’s input fields (etc) are just stored in the model associated with the main view (as opposed to having a separate view and model for the markup I want to display, as would be the case if I were to use a partial view implementation scheme).

I was wondering if anyone can give some insight as to which method is preferred or what the standard practice is (if any) on this. Is this just a matter of personal preference? Is one way more efficient than the other?

Which way should I be doing this:

  • A Partial View for the modal window markup with a separate view/model
  • A Hidden Div within the existing view/model

Note: I am working as part of a development team, so keeping things aligned with standard practice is very important.

Any thoughts on this matter would be greatly appreciated,
Thanks

Edit: I asked my fellow developers who are on the same project how they were doing things similar to this. It looks like no matter how much I debate this issue with them, they all seem to agree that the “best” and “most efficient way” to do this is to render partial views, each with a separate model. I really do not understand why they all think that this method is any more efficient than using hidden divs, but since I am currently “the new guy” I did not push the issue too much and basically just pretended to agree with the point they were trying to make about efficiency.

TL;DR : I am now using partial views, whether I like it or not. I would still like to hear some more opinions on this though.

  • 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-26T07:28:24+00:00Added an answer on May 26, 2026 at 7:28 am

    If you use the partial view for Modal Dialog, the partial view will remain inside page HMTL DOM even if the modal is closed. I suggest to use separate views for modal pop up and call it using ajax methods.

    Partial view method:

    <div id="popup_window" title="Pop up title" >
    
    <% Html.RenderPartial("_partialviewname", Model); %>
    
    </div>
    

    Next method using ajax

    Html:

    <div id="popup_window" title="Pop up title" > <!-- div to render the popup -->
    </div>
    
    
    
    <a onclick="javascript:ShowPopUp();" >Click here</a> <!--pop up is given by this link-->
    

    Ajax function part

    function ShowPopup(
    
    $("#popup_window").dialog({
                    autoOpen: false,
                    modal: true,
                    resizable: false,
                   // height: 'auto',
    
                    //width: 565
                });
    
         $.ajax({
    
                        type: 'GET',
                        url: '/controller/action', //action to return view 
                        cache: false,
                        success: function (data) {
                            $("#popup_window").empty();
                            $("#popup_window").append(data);
    
    
    
    
    
                        }
                    });
    
                    $(""#popup_window").dialog("open");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When creating a website using Asp.Net and using controls such as the ListView is
I am creating an installer for an ASP.Net website using WiX. How do you
I am in the process of creating a website using ASP.NET MVC. I went
I am new to asp.net. I am creating a ASP.net website using VB.net. So
I'm creating an API for a website. I'm using ASP.Net MVC 3 and I'm
I'm currently creating an auction website using asp and vb.net. I want to manipulate
I am creating a website using asp.net mvc model. When you create an mvc
i'm creating a shopping website using c# and asp.net and i want to use
I am creating a website using JavaScript/ASP.NET/C#/CSS/HTML/Compact SQL server. I have the majority of
I am looking into creating a new website using ASP.NET 4.0. I am currently

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.