Please assist, I have the following Ajax code
@Ajax.ActionLink(linkText: "Call An Action",
actionName: "GetCoverDate",
routeValues: new { appd = Model.AppDate },
ajaxOptions: new AjaxOptions
{
UpdateTargetId = "ajaxtarget",
InsertionMode = InsertionMode.Replace
})
My Controller Action
public string GetCoverDate(DateTime appd)
{
return appd.AddMonths(6).ToString();
}
What this does is it takes the contents of Model.AppDate and adds 6 months to it via ajax and controller's method and displays the results in a div
I'm trying to have the following changes to the code.
- Insert the returned results (date) to the appropriate EditorFor (at the moment I'm displaying the result in a div - ajaxtarget)
- The routeValue as it is, passes a date that was set as default when the view was loaded, how do I pass the value currently contained on the EditorFor (in case the user has selected a different date)?
Thank you in advance