Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Clear a Page that is being loaded by using .load jQuery

Clear a Page that is being loaded by using .load jQuery

Scheduled Pinned Locked Moved ASP.NET
javascriptcsshelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi, I have code as below, which loads a partial view in which I have a Grid, but for some reason when one of the load doesn't happen because some failure or missing View etc, the previous partial view remaining unchanged, can somebody please help me how can I clear the previous page load when loading the current Page. Any help a code snippet, a link or a suggestion anything helps thanks a lot in advance my friends.

    function GetLookupTableValue(e)
    {        
        if ($("#drpLookup").data("kendoDropDownList").text() != 'Select')
            myHeader.innerText = "List of " + $("#drpLookup").data("kendoDropDownList").text();
        else
            myHeader.innerText = "";
    
        var noCodeFilter = containsAny($("#drpLookup").data("kendoDropDownList").text(), \['Address Type', 'Gender', 'NPI Status', 'Rendering Provider Status', 'Rendering Provider Classification'\]);       
        
        if (noCodeFilter)
        {
            var url = '../Admin/GetLookupTableNoCode';
            $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() });
        }
        else if ($("#drpLookup").data("kendoDropDownList").text() == 'Medi-Cal - Mode of Service - Service Function')
        {
            var url = '../Admin/GetMCMSSFCrosswalkList';
            $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() });
        }
        else if ($("#drpLookup").data("kendoDropDownList").text() == 'Service Function Category')
        {
            var url = '../Admin/GetServiceFunctionCategoryLKPList';
            $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() });
        }
        else
        {
            var url = '../Admin/GetLookupTableCode';
            $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() });
        }
    }
    

    Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

    D 1 Reply Last reply
    0
    • I indian143

      Hi, I have code as below, which loads a partial view in which I have a Grid, but for some reason when one of the load doesn't happen because some failure or missing View etc, the previous partial view remaining unchanged, can somebody please help me how can I clear the previous page load when loading the current Page. Any help a code snippet, a link or a suggestion anything helps thanks a lot in advance my friends.

      function GetLookupTableValue(e)
      {        
          if ($("#drpLookup").data("kendoDropDownList").text() != 'Select')
              myHeader.innerText = "List of " + $("#drpLookup").data("kendoDropDownList").text();
          else
              myHeader.innerText = "";
      
          var noCodeFilter = containsAny($("#drpLookup").data("kendoDropDownList").text(), \['Address Type', 'Gender', 'NPI Status', 'Rendering Provider Status', 'Rendering Provider Classification'\]);       
          
          if (noCodeFilter)
          {
              var url = '../Admin/GetLookupTableNoCode';
              $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() });
          }
          else if ($("#drpLookup").data("kendoDropDownList").text() == 'Medi-Cal - Mode of Service - Service Function')
          {
              var url = '../Admin/GetMCMSSFCrosswalkList';
              $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() });
          }
          else if ($("#drpLookup").data("kendoDropDownList").text() == 'Service Function Category')
          {
              var url = '../Admin/GetServiceFunctionCategoryLKPList';
              $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() });
          }
          else
          {
              var url = '../Admin/GetLookupTableCode';
              $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() });
          }
      }
      

      Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      load function accepts another parameter which is a function (ajax callback) that takes in response, status and xhr. In case of any error, status will have the error code in it. You can evaluate that and do as needed. Your code can be refactored to avoid repeated blocks in if/else blocks.

      "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

      I 1 Reply Last reply
      0
      • D dan sh

        load function accepts another parameter which is a function (ajax callback) that takes in response, status and xhr. In case of any error, status will have the error code in it. You can evaluate that and do as needed. Your code can be refactored to avoid repeated blocks in if/else blocks.

        "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

        I Offline
        I Offline
        indian143
        wrote on last edited by
        #3

        Can you please give me a small sample of load response error status code and can you please give me small sample of how to refactor the repeated if else blocks. A sample or even a link helps please - thank you very much for your suggestion buddy. Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups