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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:08:33+00:00 2026-05-24T22:08:33+00:00

I have a simple ASP.net page where users can edit information about themselves. When

  • 0

I have a simple ASP.net page where users can edit information about themselves.

When “Edit” button is clicked, the form goes into edit mode and I display “Save” and “Cancel” buttons, which behave as expected.

What I want to do is this:

When “Save” is clicked, display a Javascript Confirm dialog asking the user if they want to send an email to the other users to inform them of the update just made.

If user says OK, then execute all server-side code to save the data, AND send an email.
If user says Cancel, then execute all server-side code to save the data, WITHOUT sending the email.

So, I need the javascript box to set a flag which can then be read server-side, somehow… then I can do something like:

Sub btnSave_Click(sender, e) Handles btnSave.Click

    'Save all the data

    If sendEmail Then  'This flag set by reading result of javascript Confirm
        'Send the email
    End If

End Sub

I know how to add a Confirm box to the button Attributes, and have done so. I’m looking for an answer on how to read the result of that box on server side… in other words, I ALWAYS want the Page postback to happen (from clicking the button), but only SOME of the event-handler code to execute.

Hope that makes sense.

Thanks

Matt

  • 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-24T22:08:34+00:00Added an answer on May 24, 2026 at 10:08 pm

    Create a hidden field, and set the value of that field based on the result of the confirmation. You haven’t shown the code/HTML for your button or form, but can you fit something like this into it:

    <input type="hidden" id="sendEmail" name="sendEmail" value="" />
    
    <input type="submit" value="Save" onclick="promptForEmail();" />
    
    <script>
       function promptForEmail() {
          var result = Confirm("Send everybody an email?");
          // set a flag to be submitted - could be "Y"/"N" or "true"/"false"
          // or whatever suits
          document.getElementById("sendEmail").value = result ? "Y" : "N";
       }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.Net MVC Page with a very simple form on it: One
I have a very simple ASP.Net page that acts as a front end for
I have an Asp .net page like this simple one http://issamsoft.com/app2/page1.aspx and I want
I have a pretty simple ASP.NET Web Form that looks a bit like the
I have a simple in VB/ASP.NET form containing two text boxes, I am attempting
I have a simple ASP.NET page where after the initial page load the user
I have an asp.net web page with a simple search text box that returns
I have a simple email form written in ASP.NET with the logic in the
I have created a simple login page for asp.net which takes in user name
I have a simple ASP.NET page that uses the VLC media player to play

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.