PostBackTrigger

S

Sam

Hi,
I'm developing an Ajax enabled Web Site and I've created a Web User Control
(wuc.ascx) with a Button control inside.
There is an main.aspx web page that contains these objects:
- Script Manager
- UpdatePanel2
- Modal Popup Extender
- wuc.ascx user control

wuc.ascx is inside to UpdatePanel2
UpdatePanel2 is inside to the panel of Modal Popup Extender.

I would like to refresh (postback) main.aspx page by clicking the button
inside wuc.ascx (when modal popup is running).
To do this i tried to write this code on Load of main.aspx:

PostBackTrigger pstTrigger=new PostBackTrigger();
//I wrote a property to get button ojbect from user control.
pstTrigger.ControlID = wuc1.button.UniqueID;
UpdatePanel2.Triggers.Add(pstTrigger);

When i try to run web site this error occours:

A control with ID 'ctl00$ContentPlaceHolder1$settimana1$button' could not be
found for the trigger in UpdatePanel 'UpdatePanel2'.

If I add a AsyncPostBackTrigger it works (but the behavour is not the same
and this is not what I want)

Please help me.
Thanks
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top