c# - How to enable multiple login tries in asp.net forms authentication? -


i have mvc project forms authentication.

basically works fine: user wants access controller authorize-attribute , gets redirected login-page if not authenticated. on redirect parameter returnurl gets forwarded well.

however, in case first try of login fails, return page not work anymore. think returnurl gets changed account controller after first try because case last page before current login try. authentication still seems work user stays on login page , doesn't redirected page before.

is there way prevent returnurl being changed after first failed login?

it's because of viewbag's returnurl sets null after postback,

just put

    viewbag.returnurl = returnurl; 

at beginning of httppost verb of login action.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -