473,322 Members | 1,540 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,322 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 1383

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: 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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.