I am working on asp.net MVC 4 application. I have an action link on my main view like this:
@Ajax.ActionLink("Get LinkedIn Profile","LinkedIn", new AjaxOptions
{
UpdateTargetId="partialDiv", // <-- DOM element ID to update
InsertionMode = InsertionMode.Replace, // <-- Replace the content of DOM element
HttpMethod = "GET" // <-- HTTP method
})
<div id="partialDiv"></div>
and in controller, I have action result which performs redirection to linkedIn and returns to another action result.
public ActionResult LinkedIn()
{
return Redirect("https://www.linkedin.com/uas/oauth2/authorization?response_type=code&redirect_uri=" + HttpUtility.HtmlEncode("http://127.0.0.1:81/Account/LinkedInAuthorized"));
}
now from LinkedInAuthorized I want to return a partialview or some contents which should be inserted in partialDiv, So I am doing like this:
public ActionResult LinkedInAuthorized(string code, string state)
{
// some code here
return PartialView("LinkedInProfileInfo", returnVal);
}
But it replaces whole view instead of inserting partial view in that div.
Please suggest me solution to this.