Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-10-2006, 06:34 PM   PM User | #1
shaoen01
New Coder

 
Join Date: Aug 2005
Posts: 63
Thanks: 1
Thanked 0 Times in 0 Posts
shaoen01 is an unknown quantity at this point
Prompt confirmation after button click

I wish to add an attribute to the button click in asp.net to prompt a confirmation box using javascript. Also, is it possible to perform a function after a button click before i prompt the confirmation box? This function will return a value indicating whether i should prompt the confirmation box.

I know i should add a code as shown below but it does not work somehow:
Code:
        btnDelete.Attributes.Add("onClick", "javascript:return confirm('Are you sure you want to delete these rows?')")
Thanks
shaoen01 is offline   Reply With Quote
Old 01-11-2006, 02:58 AM   PM User | #2
vinyl-junkie
$object->toCD-R(LP);


 
vinyl-junkie's Avatar
 
Join Date: Jun 2003
Posts: 3,054
Thanks: 2
Thanked 22 Times in 22 Posts
vinyl-junkie is on a distinguished road
Here is an article that walks you through exactly how to do that. Hope it helps.
__________________
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
SNAP to it!
vinyl-junkie is offline   Reply With Quote
Old 01-13-2006, 07:42 AM   PM User | #3
shaoen01
New Coder

 
Join Date: Aug 2005
Posts: 63
Thanks: 1
Thanked 0 Times in 0 Posts
shaoen01 is an unknown quantity at this point
I tried the coding but it does not work for my webform with other coding. But if i create a new webform, it will work. Not sure why though ...
shaoen01 is offline   Reply With Quote
Old 01-14-2006, 01:26 AM   PM User | #4
vinyl-junkie
$object->toCD-R(LP);


 
vinyl-junkie's Avatar
 
Join Date: Jun 2003
Posts: 3,054
Thanks: 2
Thanked 22 Times in 22 Posts
vinyl-junkie is on a distinguished road
I don't know how you're building your applications, but if you're using Visual Studio to do them, and the "are you sure" file is a code-behind file, Visual Studio builds the .dll file for it automatically. If you do an Add Existing Item within Visual Studio to an existing application, Visual Studio should still build the .dll file for you.

OTOH, if you're not using Visual Studio, you may have to build the .dll file yourself for the "are you sure" file and put it in your root directory.

If none of the above applies, then I'm as puzzled as you are.
__________________
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
SNAP to it!
vinyl-junkie is offline   Reply With Quote
Old 01-14-2006, 01:56 AM   PM User | #5
Brandoe85
teh Moderatorinator


 
Join Date: Sep 2004
Location: USA
Posts: 2,472
Thanks: 4
Thanked 40 Times in 40 Posts
Brandoe85 will become famous soon enough
Quote:
Originally Posted by shaoen01
I tried the coding but it does not work for my webform with other coding. But if i create a new webform, it will work. Not sure why though ...
Post your code so we can take a look at it.
__________________
-Brando
Why using tables for eating is stupid!
Brandoe85 is offline   Reply With Quote
Old 01-23-2006, 05:59 PM   PM User | #6
shaoen01
New Coder

 
Join Date: Aug 2005
Posts: 63
Thanks: 1
Thanked 0 Times in 0 Posts
shaoen01 is an unknown quantity at this point
Sorry for late reply, didnt know that you have submitted a new post. Anyway, i know why it does not work, because in my asp.net i included a onclick function in javascript for the same button causing it not to work.

I now use that onclick function javascript to prompt for me the confirmation box. Thanks
shaoen01 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:30 PM.


Advertisement
Log in to turn off these ads.