0

I have the following Input field inside my asp.net mvc:-

<input type="reset" value="Cancel" class="btn" />

But how i can specify that in case a user click on this button to return back to the Index action method of the current controller?

1 Answer 1

1

Wrap it in a form (GET method, and make it "submit" instead of "reset", since it's basically just a link back to the Index page):

@using (Html.BeginForm("Index", "MyController", FormMethod.Get))
{
    <input type='submit' value='Cancel' class='btn' />
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.