views:

26

answers:

0

Hello everybody.

I am building an ASP.NET custom server control. I have implemented both the IPostBackDataHandler and IPostBackEventHandler. OnPreRender I have registered the postback logic:

    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        if (Page != null)
        {
            Page.RegisterRequiresRaiseEvent(this);
            Page.RegisterRequiresPostBack(this);
        }
    }

The control uses a ImageButton (but I have also tried with a simple Button); when it is clicked I can see the page "refreshes", and some data are posted (I checked that). However, I don't know why the RaisePostBackEvent(string eventArguments) is not firing.

Does anyone know what's going on? Could someone point me to the right direction to solve this?

Thanks in advance,

Cheers, Gianluca.