How to redirect with form data in asp.net mvc? -


here situation, may little odd though: login admin, , go page form, authentication fail reason (for example, leave long not close page, or disconnect network , connect later), when post form again, goes login page. login page can returnurl , redirect previous page, all form data lost now. final result application error page.

the redirect section of login is:

    if (membership.validateuser(username, password))     {         if (!string.isnullorempty(returnurl))             return this.redirect(303, returnurl);         else             return this.redirect(303, formsauthentication.defaulturl);     } 

so ,how can redirect form data(since many page needs authentication, form data may vary action action)?

you cannot redirect form data. when redirecting using request. form data contained in body of post request. of course loop through form data keys , values , append them target url query string parameters don't forget there's limitation length of query string vary between browsers.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -