This is a migrated thread and some comments may be shown as answers.

How to do Ajax postback from a user control added at the runtime.

3 Answers 50 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 09 Aug 2010, 07:08 PM

I have a user control which I am adding to my page at the runtime.

This controls has a Telerik dropdown which does the async  PostBack using RadAjaxPanel.

Now to successfully make the dropdown postback work I need to add the control to the page on every post back.

The issue is along with this control, I am adding many other controls based on SQL query in a single function.

And all the controls do query the database to get their data which puts load on the server as well.

So I need to know is there any better way of just doing post back and refresh on the one control which I want to on async post back from the dropdown list.

And somehow avoid adding the all other controls again and again.

3 Answers, 1 is accepted

Sort by
0
Dan Miller
Top achievements
Rank 1
answered on 10 Aug 2010, 08:28 PM
Just to clarify: The problem is you have a dropdown that triggers an async ajax postback on your page and reloads ALL the controls from the database, but you just want it to reload the one control?
If this is the problem put a: if(!Page.IsPostBack) around all the controls you DON'T want to be reloaded every postback.
0
Maria Ilieva
Telerik team
answered on 13 Aug 2010, 08:56 AM
Hi Deepak,

Could you please elaborate a bit more on your scenario? Does the problem you are facing the one that Daniel described in the previous post. Did you test the provided suggestion? If yes what are the results from it?


Kind regards,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Deepak
Top achievements
Rank 1
answered on 13 Aug 2010, 02:44 PM
Well, I came to know that the controls which are getting added at the runtime needs to be added again to the page on every postback.
and I did that it starts working.
Tags
Ajax
Asked by
Deepak
Top achievements
Rank 1
Answers by
Dan Miller
Top achievements
Rank 1
Maria Ilieva
Telerik team
Deepak
Top achievements
Rank 1
Share this question
or