Return a View / PartialView with Ajax.ActionLink

Last post 10-16-2008 4:34 AM by Hollywood57. 0 replies.

Sort Posts:

  • Return a View / PartialView with Ajax.ActionLink

    10-16-2008, 4:34 AM
    • Member
      4 point Member
    • Hollywood57
    • Member since 09-19-2008, 5:02 AM
    • Posts 16

     Hello, (sorry for my english!...)

    How can I return View or PartialView after an Ajax.ActionLink call ?

    I a lot of examples, i often see that the method returns a string

    <%=Ajax.ActionLink("Test", "Test",new AjaxOptions(){UpdateTargetId="returnData"}) %>
    <span id="returnData">Change this</span>
        public class HomeController : Controller
    {
    public string Test()
    {
    return DateTime.Now.ToString();
    }
     
    But I would like to return a View or a Partial View in my page (in fact, I would return a DUNDAS Chart Graphic which datas passed to the Ajax.ActionLink)
     
    Ex:
    <div>
    <%=Ajax.ActionLink("Test", "Test",new AjaxOptions(){UpdateTargetId="returnData"}) %>
    </div> 
     
    <div id="returnData">
     my graphic
    </div>
     
    Thanks ! 

     

Page 1 of 1 (1 items)