WebForm vs WebApi how to pass data between them

Sep 25 2016 5:44 AM
Fore example, to pass data between WebForm & MVC we can use the below method 
 
protected void Link_Click(object sender, EventArgs e)
{
var httpContext = new HttpContextWrapper(Context);
var requestContext = new RequestContext(httpContext, new RouteData());
var urlHelper = new UrlHelper(requestContext, RouteTable.Routes);
Response.Redirect(
urlHelper.Action(
"Back",
"Home",
new { valuefromwebforms = "coming from WebForm1.aspx" }
)
);
}
 
Is the approach similar or its there a different way?

Answers (1)