PC Review


Reply
Thread Tools Rate Thread

button click warning

 
 
tobinlim@gmail.com
Guest
Posts: n/a
 
      13th Jun 2006
I have an ASP.NET page that successfully executes it's Button_Click
event. Now I would like to add a functionality where when the button
is clicked, a message box appears to the user warning them that
previous information is going to be lost. If they select 'OK', then
the Button_Click event proceeds as usual, otherwise they get redirected
to a previous page. I figure this requires some javascript but how??

Thanks in advance!

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5kcmVhcyBLbnVkc2Vu?=
Guest
Posts: n/a
 
      14th Jun 2006
in the codebehind page_load mehod:

string message = "hello world";
string action = "if (confirm('" + message+ "')) return true; else return
false;";
theButton.Attributes.Add("onclick", action);


Yours
andreas.knudsen[at]bekk.no

"(E-Mail Removed)" wrote:

> I have an ASP.NET page that successfully executes it's Button_Click
> event. Now I would like to add a functionality where when the button
> is clicked, a message box appears to the user warning them that
> previous information is going to be lost. If they select 'OK', then
> the Button_Click event proceeds as usual, otherwise they get redirected
> to a previous page. I figure this requires some javascript but how??
>
> Thanks in advance!
>
>

 
Reply With Quote
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button.Click event doesn't fire when clicking button in formView.InsertItemTemplate Andy B. Microsoft ASP .NET 0 25th Nov 2009 03:27 PM
How to fire both event button click and textchanged when button is click and text is changed Amy Microsoft ASP .NET 0 1st Jun 2006 03:33 PM
Button ghosts... click it works... click again it doesn't work =?Utf-8?B?QmVu?= Microsoft Access Forms 4 14th Dec 2005 01:05 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge Microsoft ASP .NET 2 26th May 2004 12:45 AM
Warning: Page has Expired When I click back button Anthony Litterio Windows XP Internet Explorer 2 20th Aug 2003 05:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:32 PM.