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

  • Home
  • SEARCH
  • 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 7743349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:30:39+00:00 2026-06-01T09:30:39+00:00

I have a jQuery post call like the following: $.post(‘/Controller/_PartialAction’, { ‘param1’: data },

  • 0

I have a jQuery post call like the following:

$.post('/Controller/_PartialAction', { 'param1': data }, function(result) { });

That’s fine and it all works, except when a user’s authentication cookie expires.

What happens is, there is already stuff in there that will redirect /Controller/_PartialAction to the login page, BUT the partial action in this case is a partial view, instead I want to redirect a full view.

So it is already redirecting that to the login page, but I want to redirect a different page, say I want to redirect to /Controller/Index. Is there any way to specify an error path or redirect path in an ajax/jQuery call?

I.E., something like this (This doesn’t exist, but like what i’m trying to do)

$.post({success}, {redirect}, {error}, {data}, {function})

So basically, how can I do a jQuery/ajax post call with a different url for errors so I can redirect to that one?

edit

What is being redirected is the ajax call itself. So I can’t redirect it from the controller.

  • 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-01T09:30:40+00:00Added an answer on June 1, 2026 at 9:30 am

    I’m not entirely sure what you’re after, but (based on http://api.jquery.com/jQuery.post/) could you use the underlying $.ajax (http://api.jquery.com/jQuery.ajax/) and set an error function?

    Or can you test for the expiration of the cookie in the success callback, then redirect based on the result of that test.

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

Sidebar

Related Questions

Let's say I have the following jQuery AJAX call: $.ajax({ type: POST, url: MyUrl,
I have a jQuery post function that returns a response on success after the
I have written a form using the jQuery .post() function to post the data
I have the following code: jQuery: $.ajax({ url: '/personcontroller/getperson', cache: false, type: POST, data:
I want to call function using post inside another jquery post like below, <script
At the moment I have a jQuery do a POST to a Controller which
I have a jQuery script: $.ajax({ url: /scripts/secure/development/ajax.asp, type: POST, dataType: text, data: cmd=addresses,
I have a form that uses jQuery to submit an ajax post and it
I have an ASP.NET application in which i want to post data using jQuery
I have the following snippet of code (I'm using jQuery 1.4.2): $.post('/Ads/GetAdStatsRow/', { 'ad_id':

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.