R – Microsoft JScript runtime error: ‘Sys.Mvc.AsyncHyperlink’ is null or not an object

ajaxasp.net-mvcruntime

I'm working on an asp.net ajax mvc application
I used Ajax.ActionLink method to add a link for updating span context using ajax, here is some part of my code :



<span id="status">No Status</span>

<%=Ajax.ActionLink("Update Status", "GetStatus", new AjaxOptions { UpdateTargetId = "status" })%>



but when I run application & click on created link, i get this error :

Microsoft JScript runtime error: 'Sys.Mvc.AsyncHyperlink' is null or not an object

can anybody help me please ???

thanks

Best Answer

Make sure you do this:

<script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>

And not this:

<script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript" />

I couldn't believe that the latter does not work!

Related Topic