locked
Error Persists after jquery-ui.min.css Was Corrected RRS feed

  • Question

  • User-1641868886 posted

    I have a datatable with an "Edit" button that calls a popup form. I get an error in debugging:

    GET http://localhost:61880/Content/Images/ui-icons_777777_256x240.png 404 (not found)

    I have corrected the path in the file the javascript debugger points to:  'jquery-ui.min.css' to correctly read "url: /Content/Img/ui-icons_777777_256x240.png". However, even after saving, rebuilding, and even restarting the machine, I still get the same error on this and one other icon image, where the debugger still shows the old path that has been corrected.

    My popup window opens, but is blank. no data, and no header or close button. I have tested the view as a stand-alone page, it is an "AddOrEdit" view, and it loads with both edit (Id=xx) and new (Id=0) functions.

    Below is the section of the "Index" action script that calls the popup:

     {
                          "data": "Id",
                          'render': function (data) {
                                return "<a class='btn btn-default btn-sm' onclick=PopupForm('@Url.Action("AddOrEdit","GrocBills")/" + data + "')><i class='fa fa-pencil'></i> Edit</a><a class='btn btn-danger btn-sm' style='margin-left:5px' onclick=Delete("+data+")><i class='fa fa-trash-o'></i> Delete</a>";
                          },
                            "orderable": false,
                            "searchable": false,
                            "width" : "150px"
                          }

    ...and here is the "PopupForm" function:

    function PopupForm(url) {
                
                var formDiv = $('<div/>');
                $.get(url)
                    .done(function (response) {
                        formDiv.html(response);
    
                        Popup = formDiv.dialog({
                            autoOpen: true,
                            resizable: false,
                            title: 'Add/Edit Record',
                            height: 500,
                            width: 700,
                            close: function () {
                                Popup.dialog('destroy').remove();
                            },
    
                        });
                        
                    });
    
            }

    Please make any suggestion on why my browser is not updating to the corrected file path per the css file. NOTE:  I don't see how the controller action can affect this, but I'll post if needed. Thanks!

    Sunday, September 16, 2018 4:06 PM

Answers

  • User-1641868886 posted


    Dillion, thanks for the reply.


    1) I see now those images were part of jquery-ui themes and should have been in their own "images" file.

    2) I cleared the browser cache and it cleared up the error.

    3) I will try the other suggestions so thanks. This may move me forward. I’ll follow-up on results.

    Thanks again!
    Reid C

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 17, 2018 4:19 PM

All replies

  • User-271186128 posted

    Hi ReidMelSam,

    I have a datatable with an "Edit" button that calls a popup form. I get an error in debugging:

    GET http://localhost:61880/Content/Images/ui-icons_777777_256x240.png 404 (not found)

    I have corrected the path in the file the javascript debugger points to:  'jquery-ui.min.css' to correctly read "url: /Content/Img/ui-icons_777777_256x240.png".

    Please open the jquery-ui.min.css file and check the image url. From the above description, it seems that the image folder name not same, you could modify them. 

    Then, clear the browser cache, and retest your application.

    My popup window opens, but is blank. no data, and no header or close button. I have tested the view as a stand-alone page, it is an "AddOrEdit" view, and it loads with both edit (Id=xx) and new (Id=0) functions.

    Try to set a break point in the AddOrEdit method, and make sure after clicking the Edit button, the AddOrEdit method should be called and it will return a view. Then in the Ajax success function, you could also add a debugger to check the response.

    Since you are using a tag and JQuery UI popup, in the PopupForm function, I suppose we should use "event.preventDefault()" method to prevent the default event. code as below:

    function PopupForm(url) {
                event.preventDefault(); //prevent the default event.
                var formDiv = $('<div/>');
                $.get(url)

    Best regards,
    Dillion

    Monday, September 17, 2018 7:53 AM
  • User-1641868886 posted


    Dillion, thanks for the reply.


    1) I see now those images were part of jquery-ui themes and should have been in their own "images" file.

    2) I cleared the browser cache and it cleared up the error.

    3) I will try the other suggestions so thanks. This may move me forward. I’ll follow-up on results.

    Thanks again!
    Reid C

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 17, 2018 4:19 PM