Showing posts with label UpdatePanel. Show all posts
Showing posts with label UpdatePanel. Show all posts

Wednesday, February 18, 2009

ASP.NET: UpdatePanel and Response.Write()

Problem

When you are modifying Response with Response.Write() from control which is inside UpdatePanel you may receive an error "Message received from the server could not be parsed"

Solution

Solution is to add a trigger to UpdatePanel like this:

</ContentTemplate>
  <Triggers>
    <asp:PostBackTrigger ControlID="btnExportToExcel" />
  </Triggers>
</asp:UpdatePanel>

This causes an UpdatePanel to refresh the page only in control specified in Triggers section

Tuesday, December 9, 2008

ASP.NET: UpdatePanel and popup with javascript

Problem

How to open popup-window with javascript when there is a UpdatePanel control in the page

Solution

You must use ScriptManager.RegisterStartupScript() instead of ClientScript.RegisterStartupScript(). That's because ScriptManager enables partial page update what AJAX needs but ClientScript doesn't enable partial page updates.