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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:04:49+00:00 2026-05-15T15:04:49+00:00

I am trying to change a value in a table from one view, and

  • 0

I am trying to change a value in a table from one view, and then redirect to another view using Flash FSCommand and Json, using the following code:

if (command == "nameClip") {
  var url = '<%= Url.Action("Index", "Home") %>';
  var clip = [args];
  try {
    $.post(url, {
      MovieName: clip
    }, function(data) {
      ;
    }, 'json');
  } finally {
    // window.location.href = "/Demo/SWF";
  }
}

In the controller:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(SWF movietoplay) {

 var oldmovie = (from c in db.SWFs where c.ID == "1" select c).FirstOrDefault();

 var data = Request.Form["MovieName"].ToString();
 oldmovie.SWFName = data;
 db.SubmitChanges();
 return RedirectToAction("Show");
}

All works well except Redirect!!

  • 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-15T15:04:50+00:00Added an answer on May 15, 2026 at 3:04 pm

    You need to perform the redirect inside the AJAX success callback:

    $.post(url, { MovieName: clip }, function(data) {
        window.location.href = '/home/show';
    }, 'json');
    

    The redirect cannot be performed server side as you are calling this action with AJAX.

    Also you indicate in your AJAX call that you are expecting JSON from the server side but you are sending a redirect which is not consistent. You could modify the controller action to simply return the url that the client needs to redirect to using JSON:

    [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult Index(SWF movietoplay)
    {
        ...
        return Json(new { redirectTo = Url.Action("show") });
    }
    

    and then:

    $.post(url, { MovieName: clip }, function(data) {
        window.location.href = data.redirectTo;
    }, 'json');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to change the value of onclick of a td from a
I'm executing the following query SELECT COUNT(*) FROM table WHERE field1='value' AND (field2 >=
I'm trying to change my WHERE clause based on the value of one column
iam confused. Iam trying to read an Value from an oracle table, format: timestamp(6).
I am trying to change the table cell from 'span' type to 'input' on
I have a simple jsfiddle where i am trying to change value of each
I'm trying to change the value of an input field with Javascript. I tried
I'm trying to change the value of a dojo tree to display the correct
I am trying to change a specific value, which has no connection to it's
I am trying to programmatically change a value of a wxRadioButton in a way

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.