Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7872413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:11:39+00:00 2026-06-03T02:11:39+00:00

I am using MVC 3 to develop a website and when user select prefer

  • 0

I am using MVC 3 to develop a website and when user select prefer language at homepage select list, the following code will handle the event. it will read the value of the select list and save it to cookies. Finally, I will submit the form in order to postback the page.

$(document).ready(function () {
    $('#lang').change(function () {

        var languageId = $('#lang').val();

        document.cookie = 'culture=' + languageId;

        $('#postback').submit();
    });
});

the problem now is the browser keep warning me when I reload the page.

the chrome says:

The page that you’re looking for used information that you entered.
Returning to that page might cause any action you took to be repeated.
Do you want to continue?

the firefox says:

To display this page, Firefox must send information that
will repeat any action (such as a search or order confirmation)
that was performed earlier.

what is the reason? and how to solve it?

EDIT

 public ViewResult Index()
    {
        int languageId = LocalizationHelper.TryGetCookiesLanguageId();

        LoginPageViewModel model = new LoginPageViewModel
        {
            LanguageId = languageId,
            Languages = Mapper.Map<IEnumerable<SvcLanguageList>, IEnumerable<Language>>(new[]{
             new SvcLanguageList{ LanguageId = 1, LanguageName="English" },
             new SvcLanguageList{ LanguageId = 2, LanguageName="简体中文" },// Simplified Chinese
             new SvcLanguageList{ LanguageId = 3, LanguageName="繁體中文" },// Traditional Chinese
            })
        };

        return View(model);
    }

EDIT 2

I have changed my jquery code to the follwing:

 $(document).ready(function () {
    $('#lang').change(function () {

        $('img#loading').show(800);
        var culture = $('#lang').val();

        $.ajax({
            url: '@Url.Action("ChangeCulture", "Account")',
            type: 'POST',
            data: JSON.stringify({ culture: culture }),
            datatype: 'json',
            contentType: 'application/json;charset=ascii',
            success: function (data) {
                window.location = '/';
            }
        });
    });
});

and here is my action in controller

 [HttpPost]
    public ActionResult ChangeCulture(string culture, string returnUrl)
    {
        Session["CultureInfo"] = new CultureInfo(culture);
        Response.Cookies["culture"].Value = culture;
        Response.Cookies["culture"].Expires = DateTime.UtcNow.AddYears(1);
        if (Request.IsAjaxRequest())
        {
            return new EmptyResult();
        }
        else
        {
            return Redirect(returnUrl);
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:11:41+00:00Added an answer on June 3, 2026 at 2:11 am

    When you submit a form, you get redirected to a new page, which was POSTed the contents of the previous page. That page would not exist without the contents of the form that was POSTed. Therefore trying to return to that page would need the same data re-POSTed to it.

    To solve this, you would need to overcome POSTing to that page, most likely with Ajax requests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ASP.NET MVC to develop a website and I need to customize my
I am using Spring MVC and want to develop a website that uses REST
I am using asp.net MVC to develop an application that will have ajax interactions.
I am using ASP MVC to develop a new project. I am using the
I'm using ASP.NET MVC to develop a web application, deploying to IIS 7. I've
I'm helping develop a MVC application in Visual Studio 2008 using the Entity Model
I am trying to develop a web application that will do the following: Collect
I'm using an MVC framework to develop a web site, I've to care about
I am using ASP.NET MVC to develop a site. The CSS file has grown
Hey guys! I'm using ASP.NET MVC to develop an application for a library with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.