locked
how to call another view from local c RRS feed

  • Question

  • User-1634604574 posted
     <div id="partialView">
        </div>
    
    <script>
    
    $("#partialView").load('@Url.Content("/c/temp/edit_print_format")');  
    
    </script>

    i want to call this page(edit_print_format) from local c insdie folder temp edit_print_format

    Thursday, October 3, 2019 5:50 AM

All replies

  • User475983607 posted

    This concept has been covered in one of your similar threads.  The following construct simply will not work due to fundamentally how web sites and the browser work.

    $("#partialView").load('@Url.Content("/c/temp/edit_print_format")');

    Url.Content() returns the absolute path to a file which has no meaning on the client.  Also, the Url.Content() method takes accepts a relative path to the host root not a network share.

    The JavaScript load function expects a URL not a file path.  

    $("#partialView").load('/path/to/the/action');

    Perhaps explain the problem you are trying to solve as there is probably an standard solution.

    Thursday, October 3, 2019 11:33 AM