I'm trying to make a link click whenever the page reloads with jQuery, however this code is not working:
@model IEnumerable<SPMVCApp.Models.Picture>
@{
ViewBag.Title = "Index";
}
<h2>@ViewBag.Mb Mb</h2>
<p>
@Html.ActionLink("Create New", "Create", null, new { id = "btn" })
</p>
<table>
<tr>
<th></th>
</tr>
</table>
<script type ="text/javascript">
$(document).ready(function(){
jQuery('#btn').click()
})
</script>
I tried using $ instead of jQuery when firing the click but still no luck, I haven't got much experience with jQuery/JavaScript