Sunday, March 11, 2012

2 TabPanels, 2 UpdatePanels and 2 Formviews

Hi,

1.The same issue ishttp://forums.asp.net/t/1170609.aspx, check out it and find a solution;

2.Another solution:

Register a control as a trigger by calling theRegisterAsyncPostBackControl(Control) method, then refresh the UpdatePanelcontrol programmatically by calling theUpdate() method(http://forums.asp.net/p/1136932/1826594.aspx#1826594)

Best Regards,


Hi Jin-Yu

Thank u for youre solution but somethings are quite unclear. The solutions are based on a button and a fileupload. I am talking about the formview event PageIndexChanged.

Now i used:

AsyncPostBackTrigger TriggerFormview =new AsyncPostBackTrigger();TriggerFormview.EventName ="PageIndexChanged";TriggerFormview.ControlID = FormView1.UniqueID.ToString();UpdatePanel2.Triggers.Add(TriggerFormview);
But this doesnt work either. Maby you could help me a bit further.

Hi,

Thank you for your feedback!

Seehttp://www.asp.net/AJAX/Documentation/Live/mref/T_System_Web_UI_UpdatePanel.aspx:

You can add anUpdatePanel control programmatically, butyou cannot add triggers programmatically. To create trigger-like behavior, you can register a control on the page as an asynchronous postback control. You do this by calling theRegisterAsyncPostBackControl(Control) method of theScriptManager control. You can then create an event handler that runs in response to the asynchronous postback, and in the handler, call theUpdate() method of theUpdatePanel control.

So, as I said in my pre reply, useRegisterAsyncPostBackControl(Control) method of theScriptManager control andUpdate() method of theUpdatePanel control.

If you have further questions,let me know!

Best Regards,

No comments:

Post a Comment