Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
WebForm vs WebApi how to pass data between them
Dilrukshan Figurado
Sep 25 2016 5:44 AM
217
Reply
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?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
show details of the selected record
How to convert string to int?