<sw**********@yahoo.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
I have a page written in C# asp.net, which allow users to select and
delete records.
How are the records presented to the user?
Once user selects the record to be deleted, I will confirm with the
user, something like "Are you sure you want to delete the selected
records?"
If yes, I will go and delete the record from SQL. How can this
confirmation and deleting process be done?
<asp:Button ID="MyButton" runat="server" Text="Delete"
OnClick="MyButton_Click" OnClientClick="return confirm('Are you sure you
want to delete this record?');" />
>>From what I understand, I need javascript to confirm with the user,
but then how can I transfer the response back to the server and delete
those selected records from the server?
That's what a postback is for... When the user clicks the above button, a
JavaScript alert will ask them to confirm that they want to continue. If
they don't, nothing further will happen. If they do, the server-side
MyButton_Click event will fire - that's where you write the code to delete
the record...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net