This is the forum to discuss the Wrox book Professional ASP.NET MVC 2 by Jon Galloway, Scott Hanselman, Phil Haack, Scott Guthrie, Rob Conery; ISBN: Professional ASP.NET MVC 2
You are currently viewing the BOOK: Professional ASP.NET MVC 2 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
Calling the "Regsiter" action method using AJAX (page 122)
Hello all,
For some reason, this piece of code does not work at least with me. Here is the code..
--
<%:Ajax.ActionLink("RSVP for this event", "Register","RSVP", new { id=Model.DinnerID }, new AjaxOptions { UpdateTargetId="rsvpmsg"})%>
--
Here is the error that I got: Microsoft JScript runtime error: 'Sys' is undefined.
and the dynamic code shown is ": <a href="/RSVP/Register/9" onclick="Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, updateTargetId: 'rsvpmsg' });">RSVP for this event</a>
The only difference that I see from your code is the "AnimateRSVPMessage()" function that you added the code and passed it to the new Ajaxoptions as a parameter.
I don't think that adding that extra function will solve the error that I have gotten. Any other options ?
Thank you!
L.G
The Following User Says Thank You to lagonave For This Useful Post:
I just saw that the code that you have posted is the next step on that tutorial on page 124. I'm still trying to get page 122-123 to work according to the book. Something is missing and I can't put my hands on it yet.
flyinhawaiian,
It works! I have removed the " <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
and placed them in the Site.Master as suggested. Now it works like a champ. Thank you sir for your help. I appreciate it.