Hi all,
Can anyone suggest me how to write the confirm box in code behind
and i want to get the return value whether the user clicked 'ok' or
'cancel',
Depending on that i need to process further using if else .
"I want pass one value which is form databse to confirm message."
Thats y i am using this calling from code behind.
Thanks in advance,
Deepthi
Loading

Ankit NandekarRank #703 · 3.4K reputationPosted Apr 22, 2011, 12:24 AM EDT
write this code on deletebutton
onClientClick="return confirm("Are you sure you want to delete current record")
Deepthi Aravind53 reputationPosted Apr 22, 2011, 12:57 AM EDT
This is not my requirement.pls read the red line indicated as above
Deepthi Aravind53 reputationPosted Apr 22, 2011, 1:31 AM EDT
My actual requirement is,
In my page, On clicking of search button i need to show this confirmation message.The message is from database.
After that i want to know user clicked is yes or no.
if user clicked yes,i want to retrieve list of items from database
raksha nirwan28 reputationPosted Apr 22, 2011, 2:12 AM EDT
For this problem, u can create a usercontrol with 2 button 'ok' and 'cancel'. write code according to you n call your usercontrol on button click. This idea can work for you.
CrishRank #1,486 · 1.1K reputationPosted Apr 22, 2011, 2:13 AM EDT
OnClientClick="return confirm('Are you sure you want to delete this User?');"
Deepthi Aravind53 reputationPosted Apr 22, 2011, 2:32 AM EDT
But i need show like a meesage box....
raksha nirwan28 reputationPosted Apr 22, 2011, 2:37 AM EDT
Make your usercontrol as a messagebox design and add this user control to your web page and show user control on button click . It will work fine as a message box. i m sure. try this at once.
Suthish NairRank #92 · 22.8K reputationPosted Apr 25, 2011, 6:37 AM EDT
Deepthi Aravind53 reputationPosted Apr 27, 2011, 3:57 AM EDT
i am using modal popup extender in ajax control tool kit...
omkar mhaiskar84 reputationPosted Apr 27, 2011, 10:02 PM EDT
yes this is the only way..
to show to confirm message box through codebehind.
Amit ChoudharyRank #145 · 15.8K reputationPosted Apr 27, 2011, 10:16 PM EDT
As your thread resolved its good but i have doubt if you were asking for confirmation box or Prompt box for you requirement??