Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @foreach (var item in Model)
- {
- @Html.ActionLink(item.Name, "Recruitments", new { Id = item.Id })
- <br />
- }
- @Ajax.ActionLink("ActionName", // action name
- "Recruitments", //controller name
- new { Id = item.Id }, // route values
- new AjaxOptions { HttpMethod = "GET", //HttpMethod Get or Post
- InsertionMode = InsertionMode.Replace, // Replace content of container
- UpdateTargetId = "Container", // id of element in which partial view will load
- OnComplete = "Completed();" }) // js function to be executed when ajax call complete
- <div id="Container">
- </div>
- <script>
- function Completed()
- {
- alert("completed");
- }
- </script>
- $("#selectorOnYourPlaceHolder").html($("#selectorOnYourLinks").html());
- $("#selectorOnYourLinks").html("")
- $.ajax({
- type: "GET", url: "somePageOrHandler.aspx", data: "var1=4343&var2=hello",
- success: function(data)
- {
- $('#someDivInPlaceHolder').html( data);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement