Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. @foreach (var item in Model)
  2. {
  3. @Html.ActionLink(item.Name, "Recruitments", new { Id = item.Id })
  4. <br />
  5. }
  6.  
  7. @Ajax.ActionLink("ActionName", // action name
  8. "Recruitments", //controller name
  9. new { Id = item.Id }, // route values
  10. new AjaxOptions { HttpMethod = "GET", //HttpMethod Get or Post
  11. InsertionMode = InsertionMode.Replace, // Replace content of container
  12. UpdateTargetId = "Container", // id of element in which partial view will load
  13. OnComplete = "Completed();" }) // js function to be executed when ajax call complete
  14.  
  15.  
  16. <div id="Container">
  17. </div>
  18.  
  19. <script>
  20.  
  21. function Completed()
  22. {
  23. alert("completed");
  24. }
  25. </script>
  26.  
  27. $("#selectorOnYourPlaceHolder").html($("#selectorOnYourLinks").html());
  28. $("#selectorOnYourLinks").html("")
  29.  
  30. $.ajax({
  31. type: "GET", url: "somePageOrHandler.aspx", data: "var1=4343&var2=hello",
  32. success: function(data)
  33. {
  34. $('#someDivInPlaceHolder').html( data);
  35. }
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement