Getting Button Click Event to my UserControl

Discussion in 'ASP .Net' started by Pingo, Apr 1, 2004.

  1. Pingo

    Pingo Guest


    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.


    //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, Apr 1, 2004
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page