Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 26th, 2007, 02:45 AM
Registered User
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding two event to a button

Hi to all,

I have a layered Pop Up window, it has some text boxes and a save button, i want when user click Save Button,the record should be saved in DB(for this i have written a function that is called against onclick of the button), and window should be closed(for that i have written a function in javascript)
How i can add do this, I have tried to use button.attribute.Add("Onclick","javascript function"); but it also does not work, the latest event handler overwrite the old event handler.

Saqlain Abbas

Old June 26th, 2007, 08:26 AM
Friend of Wrox
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts

use this code in the pagelaod

btnMyButton.Attributes.Add("onclick", "javascript:if(confirm('Are you sure you want to logout?')== false) return false;");

Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Event Handling Programmatically Wallhood Excel VBA 2 August 30th, 2007 10:42 AM
Adding Multiple Event to button in layered PopUp saqlain.abbas ASP.NET 1.0 and 1.1 Professional 1 June 28th, 2007 04:05 AM
Creation of dynamic LinkButton and Adding Event sonaldewle General .NET 2 April 14th, 2006 06:49 AM
adding SelectedIndexChanged event to listbox msrnivas General .NET 1 July 19th, 2005 02:47 PM
About Button event and Keydown event zhangxujun1981 XSLT 1 March 6th, 2004 04:59 AM

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