473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

response.write on postback

I get the error:
Sys.WebForms.PageRequestManagerParserErrorExceptio n: 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...when i postback to the
page. The problem is, i need to write some dynamic javascript on postback
and make sure it's rendered to the page.

I'm setting up Omniture analytics for my site,

<script language="JavaScript" type="text/javascript"><!--
s.pageName = "Home"
s.channel = "Home"
s.hier1 = "Home"
s.prop1="Something Dynamic Should Go Here"
var s_code = s.t(); if (s_code) document.write(s_code)//--></script>

I product an array of products to fill the "s.prop" variables. How can I
get them from the codebehind, to the s.prop1="something, s.prop2="something
more" and so on. Is there anyway to write from codebehind into the place
where s.prop starts? I tried response.write...but it fails after postback.

Thanks!
Sep 24 '08 #1
3 3282
i forgot to mention it's inside an update panel...so if I could retrieve the
variables from codebehind...i would.

"Jason Hartsoe" wrote:
I get the error:
Sys.WebForms.PageRequestManagerParserErrorExceptio n: 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...when i postback to the
page. The problem is, i need to write some dynamic javascript on postback
and make sure it's rendered to the page.

I'm setting up Omniture analytics for my site,

<script language="JavaScript" type="text/javascript"><!--
s.pageName = "Home"
s.channel = "Home"
s.hier1 = "Home"
s.prop1="Something Dynamic Should Go Here"
var s_code = s.t(); if (s_code) document.write(s_code)//--></script>

I product an array of products to fill the "s.prop" variables. How can I
get them from the codebehind, to the s.prop1="something, s.prop2="something
more" and so on. Is there anyway to write from codebehind into the place
where s.prop starts? I tried response.write...but it fails after postback.

Thanks!
Sep 24 '08 #2
response.write can not be used with update panels. nor can the panel have
inline javascript. as the update panel works by setting the innerHTML of its
div, any javascript blocks in html fragment are ignored by the browser. to
send new script with an update panel you must use the ajax scriptmanger (not
the asp.net one) and it client script register routines. scriptmanger sends
the javascript in a seperate part of the payload, and client side ajax code
parses it and adds it to the dom.

-- bruce (sqlwork.com)
"Jason Hartsoe" wrote:
I get the error:
Sys.WebForms.PageRequestManagerParserErrorExceptio n: 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...when i postback to the
page. The problem is, i need to write some dynamic javascript on postback
and make sure it's rendered to the page.

I'm setting up Omniture analytics for my site,

<script language="JavaScript" type="text/javascript"><!--
s.pageName = "Home"
s.channel = "Home"
s.hier1 = "Home"
s.prop1="Something Dynamic Should Go Here"
var s_code = s.t(); if (s_code) document.write(s_code)//--></script>

I product an array of products to fill the "s.prop" variables. How can I
get them from the codebehind, to the s.prop1="something, s.prop2="something
more" and so on. Is there anyway to write from codebehind into the place
where s.prop starts? I tried response.write...but it fails after postback.

Thanks!
Sep 25 '08 #3
i thought that may be the case...but how can I add dynamic variables to the
javascript on postback? I'm reading a DB, throwing them into an array, then
i need to output them to the javascript block....is that possible?

"bruce barker" wrote:
response.write can not be used with update panels. nor can the panel have
inline javascript. as the update panel works by setting the innerHTML of its
div, any javascript blocks in html fragment are ignored by the browser. to
send new script with an update panel you must use the ajax scriptmanger (not
the asp.net one) and it client script register routines. scriptmanger sends
the javascript in a seperate part of the payload, and client side ajax code
parses it and adds it to the dom.

-- bruce (sqlwork.com)
"Jason Hartsoe" wrote:
I get the error:
Sys.WebForms.PageRequestManagerParserErrorExceptio n: 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...when i postback to the
page. The problem is, i need to write some dynamic javascript on postback
and make sure it's rendered to the page.

I'm setting up Omniture analytics for my site,

<script language="JavaScript" type="text/javascript"><!--
s.pageName = "Home"
s.channel = "Home"
s.hier1 = "Home"
s.prop1="Something Dynamic Should Go Here"
var s_code = s.t(); if (s_code) document.write(s_code)//--></script>

I product an array of products to fill the "s.prop" variables. How can I
get them from the codebehind, to the s.prop1="something, s.prop2="something
more" and so on. Is there anyway to write from codebehind into the place
where s.prop starts? I tried response.write...but it fails after postback.

Thanks!
Sep 25 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jon Maz | last post by:
Hi, I have written a page to test a function of mine that strips non-English accents and various other characters out of a given string. The function itself (called 'StripAll' in the code below)...
11
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
4
by: Nevyn Twyll | last post by:
Is there any way I can use a code-behind event (like a btn_Click event) to write some javascript into the Response? I was thinking of using Response.Write() to write the following code into the...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
2
by: John Cosmas | last post by:
If I included a UserControl in a form, and them tell it to Response.Write some code, will the resulting client script work after the page is rendered. Let's say that I instructed the User Control...
11
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
7
by: oz | last post by:
Hi, just wondering about the following. if you put this statement in the page load event of the code behind file. Response.Write("Hello Asp.net"); Then run the page, then use the view source...
0
by: Dave | last post by:
Hi, I'm trying to download a pdf from a secure location and writ e the response to the browser as listed below. However, the form that runs this codes appears to postback when I encounter the...
3
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i have a response.write statement in my pageload and whenever i do an asyncpostback it errors out with: --------------------------- Microsoft Internet Explorer...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.