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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:30:57+00:00 2026-05-30T10:30:57+00:00

I have a requirement to show a custom modal jQuery confirmation when a user

  • 0

I have a requirement to show a custom modal jQuery confirmation when a user clicks on an Ajax ActionLink. However, when I try to add this onto the Ajax link, the ajax call continues and doesn’t allow the confirmation to stop the call. I’ve tried using OnBegin function, but when I call preventDefault it throws a method not supported error. If I return false it doesn’t allow any way to continue the call. Does anybody know how to achieve this?

Here is the link I’m trying to add the confirmation to:

<div class="sign">@Model.Email | @Ajax.ActionLink("Sign Out", "SignOut", new { area = "", controller = "Account" }, new AjaxOptions { HttpMethod = "POST" })</div>

And here is the code that I’m trying to execute:

    $('#MainNav ul li a, .header-top a').click(function (e) {
        e.preventDefault();
        var link = $(this).attr('href');
        $('.confirm-dialog .confirm-this').attr('href', link);

        $('.confirm-dialog').dialog({
            modal: true,
            draggable: false,
            overlay: { opacity: 0.8 },
            resizable: false,
            width: 400,
            open: function () {
                $('.close-dialog').click(function (e) { e.preventDefault(); $(this).parents('.ui-dialog').remove(); });
                $('.confirm-this').click(function () { });
            }
        });
    });

Any help would be greatly appreciated. I’ve already done a lot of searching and trying to figure this out but am left with the same basic problem. How do I stop the Ajax call until the User clicks on Confirm?

  • 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-30T10:30:58+00:00Added an answer on May 30, 2026 at 10:30 am

    Don’t rely too much on the predefined ActionLink way. There are two ways to archive this:

    1. The Microsoft unobstrucive Ajax methods will be added automatically to the link – you have to remove them with jquery and do the ajax call by your own. But you have to remove the handler with jquery after they have been added – thats maybe strange and I don’t know when to do that exactly.

    2. Don’t use the @Ajax.ActionLink in your case – just use build your own a tag with @Url.Action and set your onclick handler to your a tag. But you have to do the ajax call on your own as well.

    In both cases to build your own ajax call just change your confirm:

    $('.confirm-this').click(function () { $.post(link) });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Superfish jQuery menu system and have a requirement to show all
To fullfill a requirement I have to show a tooltip manually for 30 seconds.
I have a requirement where a user (while editing the content in a CKeditor
I have a requirement such that I need to add two integers using built
I have a requirement for a Tree grid or Tree list control. This is
I have a requirement that calls for a custom validator. The users want a
I have a requirement, wherein i need to show a wait message while an
i have a requirement to show javascript Ok/Cancel option on page load. So, when
I have a requirement where I need to show a Lock screen , when
I have a requirement in which i have to show TABS which we are

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.