Skip to content

MVC dynamically assign action method

Mahesh Patil

Mahesh Patil

Asked Apr 13, 2015, 6:20 AM EDT1 answer
Share
LinkedInX
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())
     
     
           
          
       
       
           
           
       

}

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

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.