Apr 20, 2010, 11:20 AM
[CLOSED] ASP.NET MVC2 LogOn
Hello,
I'm developing an ASP.NET MVC2 application based on the coolite-mvc sample code.
The Login method of the AccountController on the sample code reflects the ASP.NET MVC1 method signature:
How can I invoke the corresponding method in ASP.NET MVC2, in which username and password string parameters have been replaced by a LogOnModel object ?
I'm developing an ASP.NET MVC2 application based on the coolite-mvc sample code.
The Login method of the AccountController on the sample code reflects the ASP.NET MVC1 method signature:
[AcceptVerbs(HttpVerbs.Post)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings",
Justification = "Needs to take same parameter type as Controller.Redirect()")]
public ActionResult Login(string txtUsername, string txtPassword, string returnUrl)
{
.....
}
The Login method is invoked by the Login button in Login.aspx:....
<ext:Button runat="server" Text="Login" Icon="Accept">
<AjaxEvents>
<Click
Url="/Account/Login/"
Timeout="60000"
FormID="form1"
CleanRequest="true"
Method="POST"
Before="Ext.Msg.wait('Verifying...', 'Authentication');"
Failure="Ext.Msg.show({
title: 'Login Error',
msg: result.errorMessage,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});">
<EventMask MinDelay="500" />
<ExtraParams>
<ext:Parameter Name="ReturnUrl" Value="Ext.urlDecode(String(document.location).split('?')[1]).r || '/'" Mode="Raw" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
...
How can I invoke the corresponding method in ASP.NET MVC2, in which username and password string parameters have been replaced by a LogOnModel object ?
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
...
}
Thank you and regards.