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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:21:03+00:00 2026-05-11T01:21:03+00:00

I’m developing an ASP.Net MVC site and on it I list some bookings from

  • 0

I’m developing an ASP.Net MVC site and on it I list some bookings from a database query in a table with an ActionLink to cancel the booking on a specific row with a certain BookingId like this:

My bookings

<table cellspacing='3'>     <thead>         <tr style='font-weight: bold;'>             <td>Date</td>             <td>Time</td>             <td>Seats</td>                   <td></td>                           <td></td>         </tr>     </thead>                 <tr>         <td style='width: 120px;'>2008-12-27</td>         <td style='width: 120px;'>13:00 - 14:00</td>         <td style='width: 100px;'>2</td>         <td style='width: 60px;'><a href='/Booking.aspx/Cancel/15'>cancel</a></td>         <td style='width: 80px;'><a href='/Booking.aspx/Change/15'>change</a></td>     </tr>                 <tr>         <td style='width: 120px;'>2008-12-27</td>         <td style='width: 120px;'>15:00 - 16:00</td>         <td style='width: 100px;'>3</td>         <td style='width: 60px;'><a href='/Booking.aspx/Cancel/10'>cancel</a></td>         <td style='width: 80px;'><a href='/Booking.aspx/Change/10'>change</a></td>     </tr>   </table> 

What would be nice is if I could use the jQuery Dialog to popup a message asking if the user is sure he wants to cancel the booking. I have been trying get this to work but I keep getting stuck on how to create a jQuery function that accepts parameters so that I can replace the

<a href='/Booking.aspx/Cancel/10'>cancel</a>

with

<a href='#' onclick='ShowDialog(10)'>cancel</a>.

The ShowDialog function would then open the dialog and also pass the paramter 10 to the dialog so that if the user clicks yes then It will post the href: /Booking.aspx/Change/10

I have created the jQuery Dialog in a script like this:

$(function() {     $('#dialog').dialog({         autoOpen: false,         buttons: {             'Yes': function() {                 alert('a Post to :/Booking.aspx/Cancel/10 would be so nice here instead of the alert');},             'No': function() {$(this).dialog('close');}         },         modal: true,         overlay: {             opacity: 0.5,             background: 'black'         }     }); });    

and the dialog itself:

   <div id='dialog' title='Cancel booking'>Are you sure you want to cancel your booking?</div> 

So finally to my question: How can I accomplish this? or is there a better way of doing it?

  • 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. 2026-05-11T01:21:03+00:00Added an answer on May 11, 2026 at 1:21 am

    You could do it like this:

    • mark the <a> with a class, say ‘cancel’
    • set up the dialog by acting on all elements with class=’cancel’:

      $('a.cancel').click(function() {    var a = this;    $('#myDialog').dialog({     buttons: {       'Yes': function() {          window.location = a.href;        }     }   });    return false; }); 

    (plus your other options)

    The key points here are:

    • make it as unobtrusive as possible
    • if all you need is the URL, you already have it in the href.

    However, I recommend that you make this a POST instead of a GET, since a cancel action has side effects and thus doesn’t comply with GET semantics…

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

Sidebar

Related Questions

No related questions found

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer There is a programmatic way, and it is possible in… May 11, 2026 at 8:52 am
  • added an answer AFAIK, this isn't supported by the object model. However, LINQ… May 11, 2026 at 8:52 am
  • added an answer In a property/method on the object, in C#/VB.NET (your .NET… May 11, 2026 at 8:52 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

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.