473,563 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

response.write on postback

I get the error:
Sys.WebForms.Pa geRequestManage rParserErrorExc eption: 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="JavaS cript" type="text/javascript"><!--
s.pageName = "Home"
s.channel = "Home"
s.hier1 = "Home"
s.prop1="Someth ing 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="someth ing, s.prop2="someth ing
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 3296
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.Pa geRequestManage rParserErrorExc eption: 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="JavaS cript" type="text/javascript"><!--
s.pageName = "Home"
s.channel = "Home"
s.hier1 = "Home"
s.prop1="Someth ing 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="someth ing, s.prop2="someth ing
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.Pa geRequestManage rParserErrorExc eption: 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="JavaS cript" type="text/javascript"><!--
s.pageName = "Home"
s.channel = "Home"
s.hier1 = "Home"
s.prop1="Someth ing 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="someth ing, s.prop2="someth ing
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.Pa geRequestManage rParserErrorExc eption: 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="JavaS cript" type="text/javascript"><!--
s.pageName = "Home"
s.channel = "Home"
s.hier1 = "Home"
s.prop1="Someth ing 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="someth ing, s.prop2="someth ing
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
4023
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) now works fine. However something else in the test page is not working, and it's starting to bug me! If the user types a string containing double...
11
2152
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 datagrid. I am using the viewstate object to store the Arraylist items on the page on postback. My PROBLEM is that I need to redirect the user to...
4
4200
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 response: window.open("mynextpage.aspx","_blank", "height=300, width=450, left=100, top=100, " + "location=no, menubar=no, resizable=no, " +...
2
4325
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 displaying the contents of the data source, whilst another control updates the datasource via a command buttons implementation of 'Click', an event...
2
2451
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 in the form, to Response.Write a Window.Open instruction... John Cosmas
11
26808
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 follows: private void SubmitButton_Click (object sender, System.EventArgs e) { // Set up the response to write the print file to the client...
7
4575
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 in the browser. the "Hello Asp.net" is printed before the HTML and Body of the page. Please let me know why this is. Thanks...
0
1339
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 Response.OutputStream??? WebClient client = new WebClient(); client.Credentials = new NetworkCredential("username", "password"); byte pdfBytes =...
3
1507
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 --------------------------- Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are...
0
7659
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7882
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
5208
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.