Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Confirmation Message in ASP.NET app
Message
De
29/02/2012 14:06:00
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01536869
Message ID:
01536884
Vues:
29
>>>>>Hi,
>>>>>
>>>>>I'm getting back into an ASP.NET C# MM.NET 3.6 project that I haven't worked on in about a year so everything is rusty.
>>>>>
>>>>>The user has asked that when they click on a button they want to get a dialog saying "Are you sure?" then if they click yes the process will continue, otherwise it drops out.
>>>>>
>>>>>Is there something built into MM.NET for this?
>>>>
>>>>You can always add the following to a button..
>>>>
>>>>OnClientClick="return confirm('Are you sure you?');"
>>>
>>>OK, I have other code in the button click so I want to add that in to the code, but confirm is not being recognised as a valid command.
>>>
>>>I was trying like this:
>>>
>>>
>>> if (confirm("Are you sure?"))
>>> {
>>>
>>> }
>>>
>>>and I get the error: the name 'confirm' does not exist in the current context
>>
>>
>>No. You would add my code to the button declaration in the aspx page. This will pop up a javascript confirmation dialog. If the user presses cancel, the server side click event will not be fired.
>
>For example - in ASPX..
>
><asp:Button ID="btnDeleteRecord" runat="server" Text="Delete Record" onclientclick="return confirm('Delete this Record - Are you SURE?');" onclick="btnDeleteRecord_Click" />
>
OK, gotcha now, but I don't think that will work as I need to pass in a variable string to be displayed as part of the dialog. This string is only built up when the user clicks on the button so can't be part of the definition.

I see there is an mmMessageDisplay in MM.NET so I'll see if I can work out how to use that.

Thanks
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform