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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:14:51+00:00 2026-05-12T06:14:51+00:00

I don’t exactly understand how ASP.NETs ActionLinks work. I see that they have a

  • 0

I don’t exactly understand how ASP.NETs ActionLinks work. I see that they have a event handler for OnSuccess and OnFailure, but I can’t find anything that describes how success and failure is determined.

I’m building an ASP.NET MVC application and within it I have a Ajax.ActionLink that allows me to “vote” on items using AJAX…similiar to Digg. The Actionlink kicks off my Controller and method…everything is working fine here.

In my controller I have logic that checks to see if this user has voted before. I wanted to use “OnSuccess” and “OnFailure” to respond differently. I want it to run my Javascript function “PlusOneVote” if the user has never voted (This is the OnSuccess scenario) and if the user has voted before I want run my javascript function “CheaterYouCantVoteTwice”.

Can someone explain how OnFailure and OnSuccess are measured?

Can someone explains how I can build this logic…where I can run one Javascript function in one branch (in my case, if the user has never voted) and another Javascript function in the case that the user has already voted?

  • 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-12T06:14:51+00:00Added an answer on May 12, 2026 at 6:14 am

    Success is measured based on the HTTP Status code of the ajax response, and nothing more. Basically if you get a 400 level code (any of 400 – 417), you’ll get a failure. If you get a 200, it’s considered a success.

    I think you’ll need to examine the contents of the data in your OnSuccess handler to determine what to do, rather than considering one type a failure message and one type a success message. From the ajax perspective, it was successful if a valid response was returned.

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

Sidebar

Related Questions

Don't have much to say, just can get into the event handler. XAML: <Grid>
Don't think that I'm mad, I understand how php works! That being said. I
Don't they both have to convert to machine code at some point to execute
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't yell at me! i have seen many threads claiming that HTML cannot be
don't know better title for this, but here's my code. I have class user
I don't understand the meaning of $:<< . in Ruby. I upgraded Ruby to
(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't quite understand why this copy constructor is not invoked when I build 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.