?
Solved

Confirm Popup after click on a Repeater Button

Posted on 2008-06-12
5
Medium Priority
?
359 Views
Last Modified: 2013-12-17
I have a Repeater, it has 4 different commands for each item, I want to throw a popup box asking the user to CONFIRM the action they requested, they can say NO and nothing happends or YES and the event fires. Is there a way to do this? Is there any Confirm Control I can tie to a single button on my Repeater?

Thanks
0
Comment
Question by:victorbello
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 1400 total points
ID: 21770337
Hello victorbello,

The answer is yes, in principle you need to add a client-side script to the click event of each button. Now how to do that may vary depending on whether you are running asp.net 1.1 or 2+, I am guessing 2.0 or higher so you will need to add the onclientclick attribute e.g.,

<asp:button id="something" onclientclick="return confirm('Are you sure you want to do this?');" />

Using this it will either postback if you confirm the action or do nothing if you cancel it.

Regards,

TimCottee
0
 
LVL 15

Assisted Solution

by:NazoUK
NazoUK earned 600 total points
ID: 21770350
add this to your buttons:

OnClientClick="return confirm('Are you sure?');"
0
 
LVL 3

Author Comment

by:victorbello
ID: 21770437
Let me give that a try.
0
 
LVL 3

Author Comment

by:victorbello
ID: 21770517
It works, but I have another quick question, how do I get a linebreak on the text? I have a LONG text, i want a line break to show different lines, is it possible? I tried <br /> and Environment.NewLine but nothing, any ideas?
0
 
LVL 3

Author Comment

by:victorbello
ID: 21770712
Got it, i just needed to add the \n\r there.

Thanks for all the help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question