Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi

I am able to call asmx from Jquery when asmx is in the root folder


my Folder structure:
-----------------------
Views -> DC --search.ascx (call xx.asmx\getData)


root -- xx.asmx


The route is always searches the asmx in DC, returns 404

Please help!!
Posted

1 solution

Use it like this
url:"@Url.Content("~/")"+'xx.asmx' in your jquery
and if you are using external js File then in View add this
XML
<script type="text/javascript" language="javascript">
    window.rootUrl = "@Url.Content("~/")";
</script>

and in js file use it like thi
url: window.rootUrl +'xx.asmx'
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900