Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Confirm text on button
Message
De
22/09/2010 15:00:43
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01482319
Message ID:
01482342
Vues:
45
No prob. Saw you got it fixed, but I do the work in .Net code behind in the click event of the button.

Bill

>Bill,
>
>Thanks for the reply. You are suggesting that I change the onclick to write out the confirm dialog, but now where does the btnPutOnHold_Click event come in?
>
>
>>Hi Bob,
>>
>>I created a button to perform this task by wrting out the javascript. After checking the javascript it writes, I think you need the code in the "onclick" event, something like:
>>mm:mmButton ID="btnPutOnHold" runat="server" onclick="return confirm('Are you sure you want to put on hold?')"  Text="Put on Hold" />
>>
>>>Hello all,
>>>
>>>I have a button on a web form that when clicked runs a method. The button code is as follows:
>>>
>>>
>>>mm:mmButton ID="btnPutOnHold" runat="server" onclick="btnPutOnHold_Click"  
>>>                    Text="Put on Hold" />
>>>
>>>
>>>I now want to add a confirm messagebox that will allow the user to go ahead and run the method or cancel. I changed the code to the following to accomplish this:
>>>
>>>
>>>mm:mmButton ID="btnPutOnHold" runat="server" onclick="btnPutOnHold_Click"  
>>>           OnClientClick="return confirm('Are you sure you want to put on hold?')"  Text="Put on Hold" />
>>>
>>>
>>>This code successfully presents the confirm dialog box when clicked, however, the OnClick event does not fire when 'OK' is clicked.
>>>
>>>What am I missing here?
>>>
>>>TIA
>>>
>>>Bob
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform