Getting Button Click Event to my UserControl

P

Pingo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top