Getting Button Click Event to my UserControl

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

  1. Pingo

    Pingo Guest

    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
     
    Pingo, Apr 1, 2004
    #1
    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.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    925
    Purvi T
    Oct 19, 2004
  2. jorge
    Replies:
    2
    Views:
    1,339
    jorge
    May 26, 2004
  3. Amy
    Replies:
    0
    Views:
    1,029
  4. Max2006
    Replies:
    2
    Views:
    1,637
    Walter Wang [MSFT]
    Sep 19, 2007
  5. jorge
    Replies:
    1
    Views:
    447
    Teemu Keiski
    May 28, 2004
Loading...

Share This Page