Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2004, 10:11 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trigger event on button click

Hello,

i have one more problem which i am not able to solve.
I want to compare 2 textboxes on btnCompare_click, when they are equal to each other then ASP.NET has to show a confirmbox where i can select ok or cancel. I know how to show a confirmbox by adding the attribute to the button in the page_load.
btnCompare.attributes.add("onclick", "return confirm_copy")
But when i add this to the button btnCompare then the confirmbox is always showed and that's not what i wanted. What i did to resolve this, i made a dummy button where i attached the confirm box to but know i have the problem to trigger the btnDummy_click event. When i click the button btnCompare and the 2 textboxes are equal to each other then i want the confirmbox to be showed.

Do you understand what i mean ??
I have been searching for a solution but nothing worked out ?


 
Old June 7th, 2004, 11:49 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

So you are doing the comparison on the server side? Then you need to output a scriptlet to the client that shows the confirm dialog.

RegisterStartupScript("confirm", "<script language=""JavaScript"">confirm(...);</script>")

The hard part about this is that you'll have to figure out what to do with the return of the confirmation dialog. Remember, the confirmation is client-side so you'll have to take some client-side action to deal with the result of the confirmation.
 
Old June 19th, 2004, 06:52 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've handled all of this.
The only problem stays how to trigger the button event when i click another button?
Ive tried it with RaiseEvent but wouldn't work ?
Have you got any ideas ?

 
Old June 27th, 2004, 10:10 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Where are you trying to have this happen? You should be able to just call the other button's event handler from the handler of the button you are actually clicking on. Just call it as a regular function call and pass the arguments (sender, e).





Similar Threads
Thread Thread Starter Forum Replies Last Post
enter key should execute button click event MunishBhatia ASP.NET 2.0 Professional 6 November 25th, 2007 10:59 PM
Link button click event sarah lee ASP.NET 2.0 Basics 5 May 18th, 2007 09:29 AM
click event for vb YesNo button mohiddin52 Access VBA 2 January 14th, 2007 02:25 AM
Duplicate Control Creation on button click event kapi.goel C# 1 December 21st, 2005 02:42 PM
Input button click event not working Scott Rider General .NET 3 August 13th, 2005 12:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.