I am writing AJAX call which looks as follow:
<script type="text/javascript">
$(function () {
$.ajax({
url: @(Url.Action("_ModulePartial", "Home")),
dataType: 'html',
success: function(data) {
$('#_ModulePartial').html(data);
},
});
});
</script>
}
i want to call _ModulePatial action in Home controller in default Area using Url.Action
<script type="text/javascript">
$(function () {
$.ajax({
url: /Home/_ModulePartial,
dataType: 'html',
success: function(data) {
$('#_ModulePartial').html(data);
},
});
});
</script>
}
/Home/_ModulePartial works fine but i want to achive this using @Url.Action because we have 2 different URl http:/TestUrl.com/Test/User/Login and http://TestUrl.com/User/Login so the above Url will not work under one of the server. as 1st Url contains "Test" it is not able to find Home controller.
So can we use Url.Action in Jquery?
Firebug gives this error
SyntaxError: missing } after property list
[Break On This Error]
url: /Home/_ModulePartial,
when trying to call using @Url.Action in 1st script