Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi,

 

i need a different version of this code - all the examples i found are for prompting 'are you sure you want to delete?'

 

btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete?');")

 

and if ok is clicked, the server side function executes, and if cancel is clicked, it doesnt

 

what i need is if ok is clicked server function 'A' is called and if cancel is clicked, server function 'B' is called - or alternatively, one funciton is called with a parameter that lets me know if the user clicked ok or cancel

 

any ideas?

Posted
Instead of useing the confirm dialog, you could use a simple small web page with your message and 2 buttons on it and open it as a Modal Dialog using javascript. The modal dialog would return a value and you can determine that value and take appropriate action.
Being smarter than you look is always better than looking smarter than you are.
Posted

Thanks,

 

but i was hoping there is an easier way - the confirm button does it - but i just cant trap the cancel - i thought there might be a way of sending the 'cancel' response back to the server side code and not just the 'ok' response

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...