开发者

Problem with Ajax.ActionLink

i am reading the professional asp.net mvc book an开发者_如何学Cd implement the nerd Dinner example and when start to use Ajax :

<%: Ajax.ActionLink( "RSVP for this event",
                             "Register", "RSVP",
                             new { id=Model.DinnerID }, 
                             new AjaxOptions { UpdateTargetId="rsvpmsg" }) %> 
                                <% } %>

all right, but when click on "RSVP for this event" link the IE display error message :

"Sys is undefined"

and when click debug it refer to the line :

<a href="/RSVP/Register/4" onclick="Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, updateTargetId: &#39;rsvpmsg&#39; });">RSVP for this event</a> 

i know that "Sys" should be "System" but how to fix that .

thnks


The error messages are correct. You need to make sure you're including the correct javascript files in your view:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜