Click here to Skip to main content
11,804,008 members (76,374 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: CSS MVC jQuery dialog
I had a jquery dialog box in an MVC razor-view with a close button inside it. But on clicking the close button, the dialog just got hidden and not removed, so that when a click on any link on the page it doesnt work, which is not desired; noe do i want to redirect to my action method every time i close the dialog.

On clicking the 'X' button on the dialog-header, i get exactly what i want. So my senior now wants me to completely remove the 'Close' button and write "close" instead of 'X' in the header. I managed to do it editing my dialogbox thru my chrome browser console, on removing a whole lot of CSS class that the dialog-header uses.
But i cannot figure out fwhere to change the code(CSS or jquery) in my project in order to make this happen!! Please enlighten me about dialogboxes!!

here is my dialogbox:

$(function () {
            $.ajaxSetup({ cache: false });
            $(".ExportStatus").live("click", function (e) {
                var height = 350, width = 370;  //height = 350 width = 345;
                $('<div><span class="well"  style="position: absolute; top: 85px; left: 70px"><img src="' + loaderimagePath + '" alt="Processing your request. Please wait..." /></span></div>')
                .attr("id", $(this).attr("data-dialog-id"))
                    title: $(this).attr("data-dialog-title"),                  
                    closeOnEscape: true,
                    resizable: false,
      //              close: $(this).attr("data-dialog-titlebar-close"),         
                    buttons: {
                        "Close": function () {
                    modal: true,
                    position: 'middle',
                    width: width,
                    height: height
                .load(this.href, function (response, status, xhr) {
                    if (status == "error") {
                        var msg = "Sorry but there was an error: ";
                        $('.dialog').html(msg + xhr.status + "<br/>" + xhr.statusText + "<br/>" + xhr.responseText);
Posted 18-Nov-12 19:41pm
pratipgd at 19-Nov-12 5:11am
You can also suggest on how i can use improve the "Close" button, so that it closes without the page reloading but the page remains active.

Tried :
buttons: {
"Close": function () {
buttons: {
"Close": function () {

But they dont serve my purpose

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

  Print Answers RSS
0 OriginalGriff 3,140
1 Maciej Los 1,910
2 KrunalRohit 1,907
3 CPallini 1,845
4 Richard MacCutchan 1,187

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100