User Control with BaseUsercontrol

Last post 11-12-2009 1:46 AM by ratish_shriyan. 1 replies.

Sort Posts:

  • User Control with BaseUsercontrol

    11-11-2009, 11:29 PM
    • Member
      15 point Member
    • winned
    • Member since 11-06-2008, 2:47 AM
    • Posts 88

    I have a BaseUsercontrol

    say suppose Base User Control has Load and create buttons 


    Usercontrol1:BaseUsercontrol

    {


    }

    UserControl2:BaseUsercontrol

    {

    }


    On my webpage , I have added this BaseUserControl.

    UserControl1 and UserControl2 are loaded dynamically


    How to handle the Load_Click and Create_Click of BaseuserControl in respective UserControls. I may also need to be able to use these events in the in the individual user controls as well as web page.


    Thanks

  • Re: User Control with BaseUsercontrol

    11-12-2009, 1:46 AM
    Answer
    • Contributor
      2,194 point Contributor
    • ratish_shriyan
    • Member since 10-05-2009, 4:55 AM
    • A D I T I Technologies, Bangalore
    • Posts 308

    Hi,

    Implement IPostbackEventHandler, so that your control can handle postbacks. You can handle event in the respective control and also expose events so that can be handled elsewhere( Ex : Page ). The following article will get you started,

    http://www.myviewstate.net/blog/post/2009/05/14/Implementing-IPostBackEventHandler-in-an-ASPNET-Control.aspx

    Hope this helps!

    Knowledge Is Power
Page 1 of 1 (2 items)