Click here to Skip to main content
13,145,568 members (45,226 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2017
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