CopyPastor

Detecting plagiarism made easy.

Score: 0.8303530812263489; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2018-03-26
by Aftab Lala

Original Post

Original - Posted on 2016-09-23
by Shyju



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Revised : As per your requirenment,
You can have 3 separate form tags, one for each button. Just make sure you have an input field inside the form for the data you want to pass. For example if your action method is accepting the EmployeeId with a a parameter called EmployeeId, you should have in input hidden field with the same inside the form.
@model IEnumerable<Employee> <table> @foreach(var item in Model) { <tr> <td>@item.EmployeeName</td> <td>@item.EmployeeGender</td> <td>@item.EmployeeCity</td> <td>@item.EmployeeDateOfBirth</td> <td> @using(Html.BeginForm("Details","YourControllerName")) { <input type="hidden" name="EmployeeId" value="@item.EmployeeId" /> <input type="submit" value="Details" /> } @using(Html.BeginForm("Edit","YourControllerName")) { <input type="hidden" name="EmployeeId" value="@item.EmployeeId" /> <input type="submit" value="Edit" /> } @using(Html.BeginForm("Delete","YourControllerName")) { <input type="hidden" name="EmployeeId" value="@item.EmployeeId" /> <input type="submit" value="Delete" /> } </td> </tr> } * Also remember, nested forms are invalid HTML. So make sure you do not have those.

You can have 3 separate form tags, one for each button. Just make sure you have an input field inside the form for the data you want to pass. For example if your action method is accepting the EmployeeId with a a parameter called `EmployeeId`, you should have in input hidden field with the same inside the form.
@model IEnumerable<Employee> <table> @foreach(var item in Model) { <tr> <td>@item.EmployeeName</td> <td>@item.EmployeeGender</td> <td>@item.EmployeeCity</td> <td>@item.EmployeeDateOfBirth</td> <td> @using(Html.BeginForm("Details","YourControllerName")) { <input type="hidden" name="EmployeeId" value="@item.EmployeeId" /> <input type="submit" value="Details" /> } @using(Html.BeginForm("Edit","YourControllerName")) { <input type="hidden" name="EmployeeId" value="@item.EmployeeId" /> <input type="submit" value="Edit" /> } @using(Html.BeginForm("Delete","YourControllerName")) { <input type="hidden" name="EmployeeId" value="@item.EmployeeId" /> <input type="submit" value="Delete" /> } </td> </tr> }
Also remember, nested forms are invalid HTML. So make sure you do not have those.

        
Present in both answers; Present only in the new answer; Present only in the old answer;