I have an URL:
/Account.aspx/Confirm/34a1418b-4ff3-4237-9c0b-9d0235909d76
and a form:
<% using (Html.BeginForm())
{ %>
<fieldset>
<p>
<label for="password" class="instructions">
Contraseña:</label>
<%= Html.Password("password") %>
<%= Html.ValidationMessage("password", "*") %>
</p>
<p>
<input type="submit" value="Validar" />
</p>
</fieldset>
<% } %>
In the controller's action:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Confirm(string id, string password)
{
//code
}
I want to obtain the value of the GUID in the URL (the part after Confirm) and the value of the input password.
How can I do that?
EDIT:
I have registered this routes:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("Error.aspx/{*pathInfo}");
routes.IgnoreRoute("Admin/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}.aspx/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
routes.MapRoute("Root", "",
new { controller = "Home", action = "Index", id = "" });
}
I think anything is odd, but in the id parameter of the Confirm action I'm getting an empty string.