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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:59:47+00:00 2026-06-13T10:59:47+00:00

How can one display a confirmation box & get the return value in C#

  • 0

How can one display a confirmation box & get the return value in C# code in ASP.NET without tying it to a button? I need to display the confirmation box from inside the event handler of a button if a certain condition is filled.

Situation:

protected void okBtn_Click(object sender, EventArgs e)
{
    if (blah)
    {
        bool answer = DisplayConfirmationBox();
    }
}

Displaying it using JS is not really an issue, but getting the return value from it is.

  • 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-13T10:59:48+00:00Added an answer on June 13, 2026 at 10:59 am

    Javascript is executed on the client, ASP.NET/C# on the server.

    To get the value from your JS Dialog Box to the server, so you can work with it in your server side code, you have to either store it in a (Hidden) Text Field and perform a PostBack or do an asynchronous AJAX request.

    For the first method see the HiddenField server control and to trigger a PostBack from JS you can use

    __doPostBack(control, arg);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can any one tell me how to display a dataset value from the web
I need to display image and one button on fancybox popup but I can't
I want to know how can I display a confirmation box when the users
I want to display images in a TableView . I can display one image
Can some one tell me how do i display real time in c++. what
How can I set all images in one line and display only the first
How can I display one component on the top of another one in flex
How can one display and scroll through a multi-line strings (contain \n) via pyglet
Is there any way one can display the Silverlight 3 (Either toolkit version or
Can any one tell me if I can use a ASP Control instead of

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.