开发者

ASP.NET MVC 2 - Authentication form doesn't fire the action

开发者 https://www.devze.com 2023-01-20 03:08 出处:网络
Hi have a form that call an Action properly. But when i enable the authentication forms, the action to login doesn\'t fire up (i test it with a breakpoint).

Hi have a form that call an Action properly. But when i enable the authentication forms, the action to login doesn't fire up (i test it with a breakpoint).

My Web.config is:

    <authentication mode="Forms">
    <forms loginUrl="Autenticacao/Index"></forms>
    </au开发者_开发百科thentication>
    <authorization>
    <deny users="?"/>
    </authorization>

It's in the view Index of controller Autenticacao where i have my form:

    <% Html.BeginForm("Login", "Autenticacao"); %>
    <input type="text" id="autenticacaoReferencia" name="autenticacaoReferencia" /><br />
    <input type="text" id="autenticacaoPassword" name="autenticacaoPassword" /><br />
    <input type="submit" value="Entrar" />
    <% Html.EndForm(); %>

The controller Login is sucefully called just if the authentication form is disable.

Am i using the BeginForm in a wrong way?

Edit: The Login action:

    public ActionResult Login(string autenticacaoReferencia, string autenticacaoPassword, string returnUrl)
    {
    ...
    }

Thanks


Are you decorating your actions with the [Authorize] attribute?

0

精彩评论

暂无评论...
验证码 换一张
取 消