By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,114 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,114 IT Pros & Developers. It's quick & easy.

response.write giving error

P: n/a
Hi,

I'm working on an application whose code was written by some other developer
and I dont completely understand its source code right now. In one of the
pages where I'm writing a test code, at the end of the Page_Load event I
write a simple following line:
if (IsPostBack)
{
Response.Write("say");
}

If I write this code, than this page gives the following error in a message
box:

"Sys.WebForms.PageRequestManagerParserErrorExcepti on: 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 'say1415|updatePanel|'."

What does this mean and how can I fix this? In a normal new asp.net project
that I make and if I write the same code as above, this gets executed fine.

Regards,

...ab

Aug 26 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 26 Aug, 12:48, "Abubakar" <emailallr...@yahoo.comwrote:
Hi,

I'm working on an application whose code was written by some other developer
and I dont completely understand its source code right now. In one of the
pages where I'm writing a test code, at the end of the Page_Load event I
write a simple following line:
if (IsPostBack)
{
* Response.Write("say");

}

If I write this code, than this page gives the following error in a message
box:

"Sys.WebForms.PageRequestManagerParserErrorExcepti on: 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 'say1415|updatePanel|'."

What does this mean and how can I fix this? In a normal new asp.net project
that I make and if I write the same code as above, this gets executed fine.

Regards,

..ab
Hi

I've not seen this before but I'm not altogether surprised that it has
arisen. Response.Write() sends raw characters to the output stream
which may or may not constitute coherent data when combined with the
rest of the page content.

If you wish to put raw text onto the page then use a Literal control.
Aug 26 '08 #2

P: n/a
>If you wish to put raw text onto the page then use a Literal control.

I did use a Literal control but it was not showing up on that page, doesnt
exists if I view the source of the page and thats why I chose the
response.write.

I used the following code:

LiteralControl lc = new LiteralControl();
//lc.Text = "<script>alert('helllo')</script>";
//lc.Text = "<div>hello<br/>world</div>";
Controls.Add(lc);

I tried both of the commented lines and the litral control didnt show up.
But than I dragged one literal control from the toolbox and placed it inside
one of the controls/tables and than assigned its text property through code
and my text shows up there.

"Stan" <go********@philhall.netwrote in message
news:2e**********************************@z6g2000p re.googlegroups.com...
On 26 Aug, 12:48, "Abubakar" <emailallr...@yahoo.comwrote:
Hi,

I'm working on an application whose code was written by some other
developer
and I dont completely understand its source code right now. In one of the
pages where I'm writing a test code, at the end of the Page_Load event I
write a simple following line:
if (IsPostBack)
{
Response.Write("say");

}

If I write this code, than this page gives the following error in a
message
box:

"Sys.WebForms.PageRequestManagerParserErrorExcepti on: 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 'say1415|updatePanel|'."

What does this mean and how can I fix this? In a normal new asp.net
project
that I make and if I write the same code as above, this gets executed
fine.

Regards,

..ab
Hi

I've not seen this before but I'm not altogether surprised that it has
arisen. Response.Write() sends raw characters to the output stream
which may or may not constitute coherent data when combined with the
rest of the page content.

If you wish to put raw text onto the page then use a Literal control.
Aug 26 '08 #3

P: n/a
Ok you have some AJAX here and as the page sends something as part of the
generated markup flow at an unappropriate place, the resultig output is not
understood by the client side AJAX library...

To me it lloks like some kind of debugging message that could be
commented...

--
Patrice

"Abubakar" <em**********@yahoo.coma écrit dans le message de groupe de
discussion : OD**************@TK2MSFTNGP02.phx.gbl...
Hi,

I'm working on an application whose code was written by some other
developer and I dont completely understand its source code right now. In
one of the pages where I'm writing a test code, at the end of the
Page_Load event I write a simple following line:
if (IsPostBack)
{
Response.Write("say");
}

If I write this code, than this page gives the following error in a
message box:

"Sys.WebForms.PageRequestManagerParserErrorExcepti on: 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 'say1415|updatePanel|'."

What does this mean and how can I fix this? In a normal new asp.net
project that I make and if I write the same code as above, this gets
executed fine.

Regards,

..ab
Aug 26 '08 #4

P: n/a
On 26 Aug, 13:52, "Abubakar" <emailallr...@yahoo.comwrote:
If you wish to put raw text onto the page then use a Literal control.

I did use a Literal control but it was not showing up on that page, doesnt
exists if I view the source of the page and thats why I chose the
response.write.

I used the following code:

LiteralControl lc = new LiteralControl();
//lc.Text = "<script>alert('helllo')</script>";
//lc.Text = "<div>hello<br/>world</div>";
Controls.Add(lc);

I tried both of the commented lines and the litral control didnt show up.
But than I dragged one literal control from the toolbox and placed it inside
one of the controls/tables and than assigned its text property through code
and my text shows up there.

"Stan" <googles...@philhall.netwrote in message

news:2e**********************************@z6g2000p re.googlegroups.com...
On 26 Aug, 12:48, "Abubakar" <emailallr...@yahoo.comwrote:


Hi,
I'm working on an application whose code was written by some other
developer
and I dont completely understand its source code right now. In one of the
pages where I'm writing a test code, at the end of the Page_Load event I
write a simple following line:
if (IsPostBack)
{
Response.Write("say");
}
If I write this code, than this page gives the following error in a
message
box:
"Sys.WebForms.PageRequestManagerParserErrorExcepti on: 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 'say1415|updatePanel|'."
What does this mean and how can I fix this? In a normal new asp.net
project
that I make and if I write the same code as above, this gets executed
fine.
Regards,
..ab

Hi

I've not seen this before but I'm not altogether surprised that it has
arisen. Response.Write() sends raw characters to the output stream
which may or may not constitute coherent data when combined with the
rest of the page content.

If you wish to put raw text onto the page then use a Literal control.- Hide quoted text -

- Show quoted text -
Hi Abubakar

Sorry it's been so long since you replied.

I don't think I made myself clear in suggesting a Literal control.

The control needs to be declarative, not created programmatically.

e.g.

page source:

<form id="Form1" runat="server">
<div>
....

<asp:literal ID="ALiteral" runat="server" ></asp:literal>

....

code behind:

ALiteral.text = "<p>Hello world</p>"

If as Patrice suggested you are using Ajax then I bow out due to lack
of experience.
Sep 6 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.