Redirection Techniques in C# (MVC)

1- HTML Tag:
<input type=”button” value=”Forgot Password”
onclick=”window.location.href(‘@Url.Action(“ForgotPassword”,”Account”)’)” />

2- For posting, you could use a form:
<form method=”post” id=”signin” action=”@Url.Action(“ForgotPassword”, “Account”)”>
<input type=”button” value=”Forgot Password” />

3- Using script:
<script type=”text/javascript”>
$(document).ready(function () {
$(‘#btnForgotPassword’).click(function (e) {
location.href = ‘@Url.Content(“~/Account/ForgotPassword/”)’;

//change below input tag
<input id=”btnForgotPassword” type=”button” value=”Forgot Password” />

4- If it is a link:
@Html.ActionLink(“some text”, “actionName”, “controllerName”)

5- For posting, use a form:
@using(Html.BeginForm(“actionName”, “controllerName”)) {
<input type=”submit” value=”Some text” />

6- For Anchor Tag:
<a href=”” class=”Button”>Text</a>

7- Using RenderAction:
@{ Html.RenderAction(“ActionName”, “ControllerName”,
new { FranchiseSetId = Model.FranchiseSetID }); }


I haven’t used Delphi in a long time. Because I decided to switch to another software language 5 years ago. But a few days ago I got a free version of Delphi and checked it out. Really impressed! They did a great job. I wrote a simple application running on my Android phone in 5 minutes. That’s incredible.