Link to home
Start Free TrialLog in
Avatar of jbeg
jbegFlag for Germany

asked on

Update Repeater with AsyncAutopostback (Updatepanel) doesn´t work (VB.NET)

Hi,

I have a problem with the partial reload of a webpage:
 
My webpage has a search function. After hitting the "search" key, the site should only reload the results, not the whole page.

Hitting the "search button", the code passes a SQL-request to the database. The answer creates a Datatable, written in an Repeater.
The Repeater ist only a small part of the site, and the browser should only reload this part: the result of a new query re-fills the Repeater, without generating a whole new site.

This should work with "UpdatePanel"!?

My problem now is, that the query is indeed made¿¿, but the site does not show the result.
In Firebug I can see that the query is executed and the code that arrives at the client itself has also changed correctly (with updated data).

On my Page in the Browser, the Repeater ist not refilled, nothing happens here!

Do you have me a hint? Thank you.


Here is an extract of the code:
 
sub GetContent_Click()
 SQL-Request
 and databinding
end sub



<asp:UpdatePanel ID="UpdatePanel_Search_wikiTicket" UpdateMode="Conditional" runat="Server">
<Triggers>
     <asp:AsyncPostBackTrigger ControlID="GetContent" EventName="Click" />
 </Triggers>
 <ContentTemplate>
     <asp:Button ID="GetContent" runat="server" Text="Update Repeater" OnClick="GetContent_Click"/>

 <asp:Repeater ID="repMaster_wikiTickets" OnItemDataBound="ItemDataBound_wikiTickets" visible="true" runat="server">

my Repeater

</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>

Open in new window

Avatar of cb1393
cb1393
Flag of United States of America image

What happens when you change your updatepanel to the following (without the conditional triggers)?
<asp:UpdatePanel ID="UpdatePanel_Search_wikiTicket" runat="Server">
 <ContentTemplate>

Open in new window

Avatar of jbeg

ASKER

I've tried this, but, unfortunately, the "same thing".

Thanks for your answer!
Avatar of abhinayp
abhinayp

Remove the trigger n conditional n try.

If that doesnt help remove the updatepanels n chk if the repeater is gettin bind with postback
<asp:UpdatePanel ID="UpdatePanel_Search_wikiTicket" runat="Server">

 <ContentTemplate>
     <asp:Button ID="GetContent" runat="server" Text="Update Repeater" OnClick="GetContent_Click"/>

 <asp:Repeater ID="repMaster_wikiTickets" OnItemDataBound="ItemDataBound_wikiTickets" visible="true" runat="server">
my Repeater
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>

Open in new window

Avatar of jbeg

ASKER

Thank you for your answer!

Now I have removed the UpdateMode="Conditional". Nothing has changed.

Then I have removed the Updatepanel and when I click the Button, I get a postback and the repeater is gettin bind correctly with the new Content.

When the UpdatePanel is used, there is no postback, nothing happens on my page, but in Firebug I can see, that the repeater is filled with the new content. The databinding is done, but there is no refresh on my page.


did u remove the triggers too?
ASKER CERTIFIED SOLUTION
Avatar of abhinayp
abhinayp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jbeg

ASKER

Yes, I have removed the triggers.

It´s still the same, I can see in Firebug, that the Repeater ist filled with the new content. This needs 4 seconds (rather slow internet connection).
But there is no refresh on the page.
The new content is shown in firebug, but the page is not updated.
Avatar of jbeg

ASKER

I've postet the comment above before reading your second comment. I will test this, thank you.
Avatar of jbeg

ASKER

The example worked and helped me, to find a solution for the problem:
problem was the Response.Write in the code behind. Without it was working.