Add Action and Controller in BeginForm's HTMLHelper with T4

0

I need to add template and controller values to my T4 template, but I can not figure out how to pass the their names.

Here's an example:

CREATE.cs.t4

@using (Html.BeginForm("Create", "RamoAtividades", FormMethod.post, new {@class = "form-horizontal"})) 
            {
                @Html.AntiForgeryToken()
                    <div class="form-body">

How can I do this?

    
asked by anonymous 06.09.2017 / 03:13

1 answer

1

When you pass null to action and controller it will inherit the names of which acontroller and action that resulted in it

@using (Html.BeginForm(null, null, FormMethod.post, new {@class = "form-horizontal"})) 
            {
                @Html.AntiForgeryToken()
                    <div class="form-body">
    
15.09.2017 / 00:27