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 6927859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:06:34+00:00 2026-05-27T11:06:34+00:00

From my view I am sending via $.ajax a JSON object to my controller

  • 0

From my view I am sending via $.ajax a JSON object to my controller to save it in the database.
If all succeeded i want to redirect to another action which will show a diferent view.

If i use this code:

return RedirectToAction("CreatePage", "Survey", new {id = question.PageId});

The execution goes to the Survey controller which returns a view but it is not shown.

I have read some post which said that it is not posible to redirect via ajax.

The solution I use so far is to redirect via javascript like this:

success: function (ret) {
            window.location.href = "/Survey/CreatePage/" + $("#PageId").val();
         }

Although this always works, sometimes i need to refresh the CreatePage view to show the last changes made.

Any idea of how to solve this problem better?

Thanks in advance

  • 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-05-27T11:06:35+00:00Added an answer on May 27, 2026 at 11:06 am

    As mccow002 suggested, I wasn’t really needing to make the call via AJAX for that part. After studying the solutions suggested, i realized that i could simple submit it in a form. My confusion came because I have a save and continue editing and a save. For the save and continue I use the AJAX call, but for the save option with the form being submitted is ok.

    Thanks very much for your help.

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

Sidebar

Related Questions

I am sending a notification from one view to another view. My problem is
I redirect to a page from a grid view by sending the message id
I'm sending an image name from a view controller. In the recieving view controller
When submitting one form from view, how can i also read or have controller
Short: how does modelbinding pass objects from view to controller? Long: First, based on
My Controller Action accepts int id. What to do when calling from View ActionLink
I want to create a view from the following two tables: Entry: entry_id entry_date
I want to modify a view from Action Helper in Zend Framework in preDispatch()
I have a situation where I am sending data to a Controller via jQuery
I'm sending a HTML email from Outlook to my mail.live.com account. When I view

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.