---
title: "How to populate common bootstrap modal popup window for many pages in mvc"  
description: "How to populate common bootstrap modal popup window for many pages in mvc"  
author: "Hemant Patel"  
published: 2017-12-06  
updated: 2017-12-06  
canonical: https://www.mindstick.com/forum/34374/how-to-populate-common-bootstrap-modal-popup-window-for-many-pages-in-mvc  
category: "c#"  
tags: ["c#", "mvc4", "razor"]  
reading_time: 2 minutes  

---

# How to populate common bootstrap modal popup window for many pages in mvc

```
<div class="modal fade" id="modelDialog" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div id='modelContent'>
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title"></h4>
                </div>
                <div id="main body">
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-success">Submit</button>
                    <button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
                </div>
                <div>
                </div>
            </div>
        </div>
    </div>
</div>
```

\

## Replies

### Reply by Anonymous User

Hi Harsh,

You need to use your some code in _Layout.cshtml file in your shared folder.

and remaining code use in your render page.

Use your code like this:

1. Code in _Layout.cshtml file:

```
<div class="modal fade" id="modelDialog" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div id='modelContent'>
        </div>
    </div>
</div>
```

2. Code in your render page:

```
<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title"></h4>
    </div>
    <div id="main body">
    </div>
    <div class="modal-footer">
        <button type="submit" class="btn btn-success">Submit</button>
        <button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
    </div>
    <div>
    </div>
</div>
```

Hope this helpful for you.

\

\


---

Original Source: https://www.mindstick.com/forum/34374/how-to-populate-common-bootstrap-modal-popup-window-for-many-pages-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
