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
Mahesh Patil
NA
41
10.4k
MVC dynamically assign action method
Apr 13 2015 10:20 AM
I want to bind diff action method in single using form function,see the below code that i have stuck
@using (Html.BeginForm(null, null, FormMethod.Post, new { name = "myForm", id = "myForm" }))
{
@Html.Hidden("ConsumerServiceAndPeriod.OriginalEndHour", Model.ConsumerServiceAndPeriod.ServiceAndPeriod.EndHour)
@Html.Hidden("ConsumerServiceAndPeriod.OriginalEndMinute",
@Model.ConsumerServiceAndPeriod.ServiceAndPeriod.EndMinute)
@Html.Hidden("ConsumerServiceAndPeriod.PayCycleStartDate", Model.PayCycleBeginDate.ToShortDateString())
<div id="divclockin">
<button type="submit" name ="Create" value="ClockOut" id="btnclockin" class="submitbutton big blue" onclick ="location.href'(@Url.Action("Create", "ClockInOut", new { Model.EmployeeID, Model.ProgramID }))'"></button>
</div>
<div id="divclockout">
<button type="submit" name="Edit" value="ClockOut" id="btnclockout" class="submitbutton big blue" onclick ="location.href'(@Url.Action("Edit", "ClockInOut", new { Model.EmployeeID, Model.ProgramID, Model.ConsumerID, Model.UserID }))'"></button>
</div>
}
in that code need to assign action method dynamically,now code can only redirect on create i want also on edit action method.
Thanks in advance
Reply
Answers (
1
)
News Ticker for TV channel Scrolling
Implementing ForgotPassword in MCV 5