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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -