Click here to Skip to main content
15,891,730 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to show a popup window for list of records for select a particular record from a list page. But popup window is not showing. Please help me.

Thank you in advance.
below is my code
--------------

HTML
<h4>Departments</h4>
<a class="btn btn-success" data-toggle="modal" data-target=".DepartmentViewModel">
    <span class="glyphicon glyphicon-eye-open"></span>View
</a>
<div class="modal fade DepartmentViewModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button data-dissmiss="modal" class="close"><span>&times;</span> </button>
                <div class="modal-title">My modal</div>
            </div>
            <div class="modal-body">
                <img src="~/Content/images/Desert.jpg" />
                <p>
                   Some text here or Add fields here..
                </p>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary">Submit</button>
                <button class="btn btn-default" data-dissmiss="modal">Cancel</button>

            </div>

        </div>
    </div>

</div>


What I have tried:

Please help me.

Thank You very much in Advance.
Posted
Updated 28-Jul-16 2:16am
Comments
F-ES Sitecore 27-Jul-16 7:55am    
Html does not have the concept of pop-up windows, you normally need some kind of javascript plug-in to make them work and there is no indication of any such code in what you have posted.
Karthik_Mahalingam 28-Jul-16 8:16am    
check my solution

Assuming you're using Bootstrap[^], the data-target attribute needs to be the ID of the modal dialog element. You can't use a generic jQuery selector, as that could match multiple elements.

HTML
<h4>Departments</h4>
<a class="btn btn-success" data-toggle="modal" data-target="#DepartmentViewModel">
    <span class="glyphicon glyphicon-eye-open"></span>View
</a>
<div class="modal fade" id="DepartmentViewModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button data-dissmiss="modal" class="close"><span>&times;</span> </button>
                <div class="modal-title">My modal</div>
            </div>
            <div class="modal-body">
                <img src="~/Content/images/Desert.jpg" />
                <p>
                   Some text here or Add fields here..
                </p>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary">Submit</button>
                <button class="btn btn-default" data-dissmiss="modal">Cancel</button>
 
            </div>
 
        </div>
    </div>
</div>
 
Share this answer
 
Comments
Karthik_Mahalingam 27-Jul-16 13:43pm    
5
Member 12224368 28-Jul-16 7:49am    
Thank You very much sir..
It's working
Member 12224368 28-Jul-16 7:55am    
Karthik Sir,
Submit and Cancel buttons are not working..
Please guide me what logic should I apply.
Refer this for complete documentation on BootStrap Modal[^]

C#
data-dissmiss="modal" // spell error 
change to
C#
data-dismiss="modal"


for Save button, you will have to map an event to it and inside the event you close the popup.
refer bootstrap modal save button click and close [^]
 
Share this answer
 
Comments
Member 12224368 29-Jul-16 0:53am    
Thank you sir.. it's working
Karthik_Mahalingam 29-Jul-16 1:25am    
cool,
Member 12224368 29-Jul-16 2:23am    
marked sir
Karthik_Mahalingam 29-Jul-16 2:25am    
Thank you, i would recommend you to go through the tech docs before implementing any new feature, so that you will get to know what and all features available in the framework. it will help you to enhance the knowledge..
Member 12224368 29-Jul-16 2:29am    
Ok Sir

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900