views:

104

answers:

1

I am trying to bind a repeater after an AJAX response. Step 1 : Make an Ajax call to the fucntion in the code behind:
Step 2 : Do some business logic and finally bind the data to the repeater
Step 3 : Get the response back from the codebehind to the Ajax call
Step 4 : Once we get the response back what is the right way to strip out extra HTML for example the head and body tags etc.

One way is to put a "breaker" logic. for example :

<html><body>
#breaker
REPEATER control HERE
#breaker
</html></body>

and once I get the response back I use a JS function to find anything between the #breaker tags and strip out anything outside and I should get the required HTML response of only the repeated items.

Is this the only / Best way to achieve this kind of functionality?

A: 

Couldn't really understand your question. How exactly is the AJAX call implemented? A straightfroward method might be just place all your required controls in the UpdatePanel and let it handle the AJAX postback without worrying about the stripping of "HTML" tags.

This might help if you are new to UpdatePanel: http://www.asp.net/Ajax/Documentation/Live/overview/UpdatePanelOverview.aspx

o.k.w