TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Krishna Kumar
NA
135
39k
calling webapi controller from aspx page
Dec 26 2016 6:04 AM
Hi ,
i have the below controller
[HttpPost, Route("EmployeeProfile")]
public HttpResponseMessage Create(HR_EmployeeProfile EmployeeProfile)
{
return Request.CreateResponse(HttpStatusCode.OK, _EmployeeProfileManager.Create(EmployeeProfile));
}
and i have the below aspx page
protected void BtnSaveEmpDet_Click(object sender, EventArgs e)
{
var emp = new EmployeeProfile();
emp.MiddleName = txtMiddleName.Text;
emp.LastName = txtLastname.Text;
emp.Add_Street1 = txtAddStreet1.Text;
emp.Add_Street2 = txtAddStreet2.Text;
emp.Add_City = txtAddCity.Text;
emp.Add_State = txtAddState.Text;
emp.Email = txtEmail.Text;
}
where EmployeeProfile is a model and i am assigning the input values from textboxes and assigning them to the field values in the model. Now, i want to send the emp object to the controller for creating the profile.
how could i do that?
Reply
Answers (
5
)
how to use stored procedurewith drop down list in mvc5
Pagination in wed data connector