ASP.NET Ajax Update Panel in ContentPlaceHolder

Asked By c g
12-Feb-07 11:20 AM
Earn up to 0 extra points for answering this tough question.

Hi,
I have a ScriptManager and UpdatePanel as below

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<uc1:SecurityFloatingCharge runat="server" ID="uctrSecurityFloatingCharge" />

</ContentTemplate>

</asp:UpdatePanel>

</asp:Content>

When I run my page I get an error stating "Sys.WebForms.PageRequestManagerParserErrorException : The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, httpModules, or server trace is enabled. Details: Error parsing near 'et>"

 

When I don't use a Master Page and have my aspx like below without a ContentPlaceholder it works fine. Anyone know why?

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">

<title>Partial-Page Update Error Handling Example</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<uc1:SecurityFloatingCharge runat="server" ID="uctrSecurityFloatingCharge" />

</ContentTemplate>

</asp:UpdatePanel>

</div>

</form>

</body>

</html>

 

  try this

K Pravin Kumar Reddy replied to c g
12-Feb-07 11:33 AM

place

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

this in master page use update pannel in content place holder...this will work,,,:)

  steps for Using the ASP.NET UpdatePanel Control with Master Pages

K Pravin Kumar Reddy replied to c g
12-Feb-07 11:38 AM

Using the ASP.NET UpdatePanel Control with Master Pages

Any ASP.NET page that includes an UpdatePanel control also requires a ScriptManager control. To use UpdatePanel controls with master pages, you can put a ScriptManager control on the master page. In this scenario, the master page provides a ScriptManager control for every content page. If you do not want partial-page updates enabled for individual content pages, you can disable partial-page updates for those pages.

Alternatively, you can put the ScriptManager control on each content page. You might do this if only some of the content pages will contain UpdatePanel controls.

You can see the code in action in this tutorial by clicking the Run It buttons. To implement the procedures in your own development environment you need:

  • Visual Web Developer Express Edition or Microsoft Visual Studio 2005.

  • The latest release of Microsoft ASP.NET AJAX installed and configured. For more information, see Installing ASP.NET AJAX.

  • An ASP.NET AJAX Web site

check out complete example

http://ajax.asp.net/docs/tutorials/UsingUpdatePanelMasterPages.aspx

  Thanks. That works.

c g replied to K Pravin Kumar Reddy
12-Feb-07 12:56 PM
Thanks. That works.
  How to get a handle on the ScriptManager frommy ASPX
c g replied to K Pravin Kumar Reddy
12-Feb-07 01:08 PM

I have a master page called Test.Master which has a ScriptManager.

On my Test.aspx which uses this Master Page I have my Update Panel.

How can I get a handle on the ScriptManager contol taht resides on my Test.Master from the codebehind of my Test.aspx?

  Working with ASP.NET Master Pages Programmatically
K Pravin Kumar Reddy replied to c g
12-Feb-07 09:04 PM

here am trying to access master page lable ...

Label headerLabel = (Label) Master.FindControl("Header");
headerLabel.Text = "This label content is set through the
           Page_Load event of the child page";

use Master.FindControl to access any control in master page

reference links

http://msdn2.microsoft.com/en-us/library/c8y19k6h.aspx

http://www.devx.com/dotnet/Article/18042/0/page/2

 

  Thanks.
c g replied to K Pravin Kumar Reddy
13-Feb-07 05:10 AM
Thanks.
Create New Account