Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Action after confirmation from client -- asp.net

Reply
Thread Tools

Action after confirmation from client -- asp.net

 
 
sweetpotatop@yahoo.com
Guest
Posts: n/a
 
      09-21-2007
Hi,

I have an asp.net project written in C#

It has a list of records for users to delete and select. When user
click the "Delete" button, I would like to ask the user to confirm
before I proceed.

And I have something like this in my code
button1.Attributes.Add("onClick", "return confirm('Some Prompt');");

If the user says yes, I have to run the code in server, which will
delete the records.

My question is, how does the server-side code gets the return value of
the confirmation, which I believe on the client-side?

Please help. Your help would be greatly appreciated.

 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      09-21-2007
It doesn't. The confirmation should basically abort the whole process if the
user doesn't confirm. This will mean that the only way to actually get to
the postback stage is to return a true condition from the confirm. Otherwise
the postback won't occur and the code just won't get executed so there's no
need for you to try to get the values.


--
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

<> wrote in message
news: oups.com...
> Hi,
>
> I have an asp.net project written in C#
>
> It has a list of records for users to delete and select. When user
> click the "Delete" button, I would like to ask the user to confirm
> before I proceed.
>
> And I have something like this in my code
> button1.Attributes.Add("onClick", "return confirm('Some Prompt');");
>
> If the user says yes, I have to run the code in server, which will
> delete the records.
>
> My question is, how does the server-side code gets the return value of
> the confirmation, which I believe on the client-side?
>
> Please help. Your help would be greatly appreciated.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts: 1 action, 1 Form, several views handled by 1 only action. Any idea for better design? John Java 0 06-26-2007 11:22 PM
Can we call an Action from another Action in struts??? vyshu Java 1 04-27-2007 09:19 AM
Struts mapping action to action??? runescience Java 3 02-07-2006 04:07 PM
Struts Forward to an Action from an to Action and URLs rjweytens Java 6 06-25-2004 01:49 PM
Struts Static Action Form vs Dyanamic Action Form Joe Bloggs Java 1 08-03-2003 02:30 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57