.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

confirm dialogbox

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :ASP.Net
I have a vb.net codebehind function 'ExtractFile' which i need to prompt for confirmation before executing the rest of my code. I dont know the best way to do this 

View Complete Post

More Related Resource Links

jquery confirm windows isn't working


Hi, i am using jquery to implement a modal confirm windows but it not working

i have a template field button with ajax confirm using jquery but i have a problem. Apper the confirm windows but when i click on "yes" doesn't execute the delete command. without ajax (using template field button and simple confirm windows javascript) works so well.

Can you give me a hand with this?

thx in advance!

<link href="_assets/css/StyleSheet.css" rel="stylesheet" type="text/css" />
<link href="_assets/css/confirm.css" rel="stylesheet" type="text/css" />
<script src="_assets/js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="_assets/js/jquery.simplemodal-1.1.1.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
       $(".deleteCustomer").click(function(ev) {
                var msg = $(this).attr("title");
                confirm(msg + "?");

{ End Bracket }: To Confirm is Useless, to Undo Divine


The common user interface technique of confirmation, popping a dialog box into the user's face and asking, "Are you really REALLY sure you want to do that?" is evil. It's unfriendly, it's distracting, and it's completely ineffective.

David S. Platt

MSDN Magazine March 2005

Confirm message box on some conditions

Hi,In one of our application, after saving the data successfully we have to show the confirm message box whether to continue the process or not. On click of the yes i have to call one function.So how can i get confirm message box based on condition and how can i read the return value of the confirm message box to call other functions.Thanks in advance,Aruna

ListSearchExtender causing double postback when alert() or confirm() is called within PageRequestMan

This is a weird one.   I'm trying to implement a confirmation dialog before an async postback.  The idea is to use the JavaScript confirm() function to allow the user to cancel the postback.  I'm implementing it this way because my page has a bunch of different controls that might trigger an async postback inside an UpdatePanel.  Some of these are Ajax Control Toolkit controls like the ComboBox.  Rather than trying to trap the DOM event that triggers postback for each of these controls, it's easier to write one function and attach it to the client side initializeRequest event of the PageRequestManager, calling set_Cancel(true) or abortPostBack() if the user does not confirm.  This function can also be a central place to undo any changes if the user does not confirm.The problem is that the act of popping up the confirm dialog causes the UpdatePanel to postback twice, but only when the triggering control is a DropDownList (with AutoPostBack enabled, of course) with a ListSearchExtender.  If I replace the confirm() with alert(), the same thing happens.  If I comment out the alert, the problem goes away.  Below is a stripped-down page to reproduce the issue.  (I tested with IE 8/FF 3.5, and also tried both the new ASP.NET Ajax Library Beta 0911 and the old AJAX Control Toolkit Version 3.0.30930.)<%@ Page Language

Confirm js is not working

hello friends,                 i need a little help, i have create a javascript as abovefunction ProgressShowForDelete(){            //  find the popup behavior            alert('coming');            var answer = confirm("Are you sure you want to delete this Category?")            if (answer){               alert('tr');                this._popup = $find('ctl00_Body_mdlPopup');                this._popup.show();            }            else{                            }                             }it

JS Confirm Raisng an Error

When I run the page using the following js I get an error "Object Required" on the beginning of the second line. <script language ="javascript" type="text/javascript" > <!--    function valSubmit() {        var msg; ==>>  var msg = "Is this the Budget Request Item number to be deleted?" & document.getElementById('txIDNumber').value;        if (msg){            confirm(document.getElementById('txtIDNumber').value & "Has been deleted");            }        else{            window.location = "MainMenu.asp";            }    }  //--></script>   <asp:Button ID="btnDelete" runat="server" Text="Delete Record" Width="119px" />   Code BEhind  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load"onClick", "return val

Popup Confirm that forces user input for ok button

Hi Everyone, Does anyone know how to do a popup confirm that has a textbox where the user types in a comment.  Currently I am using just a confirm pop up.  What I really want to do is make is so the user cannot click on the ok button until there is something typed into the textbox but they can hit the cancel button at any time without providing a comment.  Any suggestions? Thanks! -Nici 

confirm delete


protected void Button8_Click(object sender, EventArgs e)

        DropDownList ddlCardDetails = LoginView2.FindControl("ddlCardDetails") as DropDownList;
        BurnbetDataContext ctx = new BurnbetDataContext("data source=.\\SQLEXPRESS;Integrated Security=SSPI;" + "AttachDBFilename=|DataDirectory|\\BurnbetDatabase.mdf;User Instance=true");
        int Id = -1;
        if (int.TryParse(ddlCardDetails.SelectedValue.Split('|')[0], out Id))
            tbl_Payment democustomer = ctx.tbl_Payments.SingleOrDefault(c => c.ID == Id);
            if (democustomer != null)


                if (string.IsNullOrEmpty(ddlCardDetails.SelectedValue))

                    RadioButton RadioButton1 = (RadioButton)LoginView2.FindControl("RadioButton1");

                    Control div = LoginView2.FindControl("RegisterGroup");
                    RadioButton RadioButton11 = LoginView2.FindControl("RadioButton1") as RadioButton;
                    Control CreditCardDetails = LoginView2.FindControl("CreditCardDetails");
                    Control NewCreditCard = LoginView2.FindControl("NewCreditCa

Display confirm message using javascript after user successful logs in



I need to display a javascript confirm box after the user successfully logs into the application. If the select 'yes'  of the confirm box then I need to navigate them to a different page and if they select 'no' the default.aspx page should be displayed. I am using the login control.

I tried to use ClientScript. RegisterClientScriptBlock on Login1_Authenticate event, it didn't work. I tried the same thing on the Page_Load event of Default.aspx as well as Master Page load event, that also didnt work.

How can this be accomplished? Need a quick resolution.



How to confirm delete



 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        if (e.Row.RowType == DataControlRowType.DataRow)
            // reference the Delete LinkButton
            LinkButton db = (LinkButton)e.Row.Cells[0].Controls[0];

            // Get information about the product bound to the row
            Northwind.tbl_zaposleniRow product = (Northwind.tbl_zaposleniRow)((System.Data.DataRowView)e.Row.DataItem).Row;

            db.OnClientClick = string.Format("return confirm('Are you certain you want to delete the {0} product?');", product.Replace("'", @"\'"));

 <asp:GridView ID="ProductsGrid" runat="server" AutoGenerateColumns="False" DataKeyNames="ID,UserId"
            OnRowUpdated="ProductsGrid_RowUpdated" OnRowDataBound="GridView1_RowDataBound" AllowPaging="True" AllowSorting="True" 

            <asp:CommandField ShowDeleteButton="True" ValidationGroup="InsertValidationControls" />


confirm JS is not working on imagebutton click


Dear Frens

I have a new issue, which i want to share.

When working with ASP.NET 1.1 Framework there is an imagebutton on click of that imagebutton client side validations are fired since it is an online application form

cline side validations are must i am using a javascript when user submitting the application form

for confirm messege .

but it is not working ... if i do the causevalidation="False" for the imagebutton it is working but the validation are bypassed.

How to achieve this please suggest

Thanks in Advance


how to make Use custom Confirm box in Asp.net


I have a Custom confirm box with Yes No.....The function executes in Jquery when click on Yes/No.

But I want to exec my code there.....how it is to be done?

Thankyou in Advance

This is code

//This is the file creating ConfirmBox

<script type="text/javascript" src="scripts/jquery.alerts.js"></script>

<script type="text/javascript" >
    jConfirm('Do you wan

Confirm Box on Hyperlink


<asp:HyperLinkField DataNavigateUrlFields="Note ID,ID" DataNavigateUrlFormatString="../Contact%20Management/DeleteNote.aspx?NoteID={0}&ID={1}" Text="Delete" />

Is there any way to show confirmbox when click on delete?

<asp:HyperLinkField DataNavigateUrlFields="Note ID,ID" 
                                            DataNavigateUrlFormatString="../Contact%20Management/DeleteNote.aspx?NoteID={0}&ID={1}" Text="Delete" />

ex: onclientclick="return confirm('xxx');"?

or any way to do this with also navigating data?

How to confirm that OS date and time has been changed?



How to confirm that the system OS date and time has been changed in .Net?


Gnanasekar Babu Note: Please click on the vote button if the answer helps you

JS Confirm not working


In my button Save event, I have to ask the user if they have something else to do before they proceed with the save. The below js seems to execute, but doesn't return back to the event (and proceed) if I choose Cancel and I don't get my screen back if I answer OK. Am I doing something incorrect with the function?

Here is my server side code inside the Save button event:


if (tsPatientDemographics.SelectedTab.Text == "Pri Ins")
                String s = "Sec_Ins()";
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Secondary Insurance?", s, true);


Here is my js code:


function Sec_Ins() {

    if (confirm("Is there Secondary or Tertiary Insurance information available?") == true) {
        return false;

Calling Javascript confirm from server-side



This normally should not be difficult but I am just starting javascript.

The case is very simple.Before I delete  the record from the gridview ,I want to call the confim windows in order to give the user the opportunity of ok oe cancel.

in the client side I do not have any reference to javascript.

The first touch with it ,it happents in the following code:

 public void grdomas_RowDataBound(Object sender, GridViewRowEventArgs e)
            if (e.Row.RowType == DataControlRowType.DataRow)
                ImageButton  l = (ImageButton)e.Row.FindControl("imgdelete");

                l.Attributes.Add("onclick","javascript:return " + "confirm('Are you sure you want to delete this record? ')");

The image button is defined in the aspx as:
<asp:ImageButton ID="imgdelete"   runat="server" ImageUrl="~/Images/DeleteNew.bmp"  Width="20px" Height="20px" ToolTip="Delete" CommandName="Delete" CommandArgument='<%# Container.DataItemIndex + 1 %>'/>

Javascript confirm() to be shown in asp.net page



I have a button click event which has to do some validation and if one of the validation fails then confirm with the user whether he wants to continue anyway.

For this, I tried an approach with javascript confirm() method but the problem is that the server side event already gets completed and then the confirmation is shown to the user.

Please help to show the confirmation box and based on the user input the server side event should complete.

 validate(); //SERVER SIDE EVENT

if(some validate fails)
     show confirmation box //JAVASCRIPT

if(conf == OK)
   //do something and complete server side event
else if (conf == CANCEL)
   // do something else and return


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend