I have an problem here. In jquery ajax when we define url here its been expsed to outside world
there is chance it would be missued by others how can we overcome this so that URL is encoded ? ar actionUrl = '@Url.Action("GetMovieslist", "Getjson")';
<script type="text/javascript">
//Actionname attribute used here.
$(document).ready(function () {
$("#btnGetMovies2").click(function () {
//var actionUrl = '@Url.Action("GetMovieslist", "Getjson")';
var actionUrl = '@Url.Action("GetMovieslist", "Getjson")';
$.getJSON(actionUrl, displayData2);
});
});
function displayData2(response) {
if (response != null) {
for (var i = 0; i < response.length; i++) {
$("#movieList2").append("<li>" + response[i].Title + " " + response[i].Genre + " " + response[i].Year + "</li>")
}
}
}
</script>
So is there any way we can oversome this issue