0
I am starting my studies with Asp.Net MVC and I am able to call a view from the main menu. I have an initial view "_Layout" with the following menu item:
<li>
<input type="radio" name="tabs" class="rd_tabs" id="tab3">
<label for="tab3">Currículo</label>
</li>
And I’m trying to call the controller/action this way:
@section Scripts{
<script>
$(document).ready(function () {
$('#tab3').click(function () {
$.ajax
({
url: "/Home/Curriculo",
type: 'GET',
success: function (dados) {
console.log("sucesso");
},
error: function (erro) {
console.log("falha");
}
});
});
})
</script>
}
But nothing happens, even though Function is running and printing "success" on the console. I’ve tried calling the url in different ways but nothing has worked.
I would like the help of colleagues to know where I am going wrong. Thank you!
Well try instead of successfully having the console print the data and look if there is an html code, what happens and that it returns on the same page the data you would have to do something with the page returned.
– Rodrigo de Souza silva
Yes, it returns the page, but I did not know that I would have to treat the return. I imagined that the action itself would call the page.
– Jonas Santos