473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting Button Click Event to my UserControl

Hi!

How do I handle a Page event in my UserControl.

My .aspx page contain 5 different buttons and one of them is the SAVE button.
All buttons do PostBack to the page but only one should Save the data in the forms.

I want my UserControl to know when the SAVE button is clicked.

example:

//this code is what i would like in my UserControl
if (IsPostBack) {
if (???) { // Is Save Button = clicked
//Save some data in my UserControl
}
}
//this code is in the .aspx page

private void submitbtn_Click(object sender, System.EventArgs e) {
// do something here
}

private void InitializeComponent() {
this.submitbtn.Click += new System.EventHandler(this.submitbtn_Click);
}
Hope you understand my problem.

Kind Regards,
Pingo
Nov 18 '05 #1
0 1092

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Scott Schade | last post by:
I have a form onto which I add a control during execution. The control is a control that I wrote. The control has a number of controls on it. I would like to click on a button on the control and...
4
by: athlonman | last post by:
Hi all!! II'm trying to set the Text of a TextBox in "Form1" when I click a Button in a UserControl. My code is: : public class Form1 : System.Windows.Forms.Form { public...
2
by: Cederstrom | last post by:
Hello Group, I have created an ASP.NET page. The page consist of the following items: - Button A - Button B - UserControl When I press Button A, I execute the following code: ViewState =...
0
by: Pingo | last post by:
Hi! How do I handle a Page event in my UserControl. My .aspx page contain 5 different buttons and one of them is the SAVE button. All buttons do PostBack to the page but only one should Save...
4
by: Luca | last post by:
HI, I've a asp.net application that add a dynamic usercontrol with a button. If i've tried to click it Click Event don't load. But into a static usercontrol it's happens. Anyone can help me?
4
by: Sugan | last post by:
Hi all, I've created a Custom button control and i'm drawing the graphics for the button when the paint event is fired. I used Invalidate method to redraw the graphics in events like mousemove,...
0
by: davidr | last post by:
Hi, I've read about bubble events and setting up the event args and several other methods to have an event that occurs in a usercontrol flow up to the parent. The problem is each one entails a...
4
by: xkeops | last post by:
I'm working in VS2003 VB.NET environment. I created a based class template (BasePage) and there is a new aspx win form (winform1.aspx) inheriting BasePage. In winform1.aspx I have added a new...
0
by: spothineni | last post by:
Hi Guys, Today i am facing problem with dynamic controls.Thing is I have a dropdown combo which is having list.i have button and UserControl. when i select dropdown value and click on...
0
by: thersitz | last post by:
Hi, Using aspnet3.5,VStudio 2008, VB 1.) I have a set of pages, with a search text box button within a userControl that searches across our websites and is registered in a masterpage. 2)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.