473,512 Members | 14,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax error when using response.write()

I'm brand new at ajax. In fact, about 20 minutes ago was the first time I
got it to work. The problem I'm having on another page did not work,
however.

I'm running into the following 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(), response filters,
HttpModules, or server trace is enabled.
Details: Error parsing near 'greengreengreengreen'.
This is my code. The strBorder variables is filled with an RGB color string
from the code behind page, ie, the color Green (as noted in the error
message I guess). I'm basically changing the color of a text box border
based on what is being returned from the database. Its a system status
message so if things are going wrong, a little red stop light is loaded next
to the message and the border around the message changes to red.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="15000"
Enabled="true" OnTick="Timer1_Tick" />

<asp:DataList ID="dlSystemStatus" runat="server" RepeatColumns="1"
Width="100%">
<ItemTemplate>

<div style="border-bottom: 4px;
border-left: 4px;
border-right: 4px;
border-top: 4x;
border-bottom-style: double;
border-left-style: double;
border-right-style: double;
border-top-style: double;
border-bottom-color: <%Response.Write(strBorder) %>;
border-left-color: <%Response.Write(strBorder) %>;
border-right-color: <%Response.Write(strBorder) %>;
border-top-color: <%Response.Write(strBorder) %>;
background-color: White;
margin-right: 5%;
padding:5px;
font-family:Tahoma;font-size:10pt;">

<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="width:40px;"><img
src="<%Response.Write(strLight)%>" align="absmiddle" /></td>
<td valign="top">
<i>Posted By <%# Eval("originator") %>, <%#Eval("jobdesc")%on <%#
Eval("date") %at <%#Eval("time")%></i>
<hr size="2" color="black"/>
<b>Customer Message</b>
<br />
<%# Eval("message") %>
<hr />
<b>Technical Details</b>
<br />
<%#Eval("technical")%>
</td>
</tr>
</table>

</div>

</ItemTemplate>
</asp:DataList>

</ContentTemplate>
</asp:UpdatePanel>

If AJAX can't handel the Response.Write within the update panel, is there
another way to go about this?

TIA,
Jim
Jun 27 '08 #1
7 3279
On Tue, 6 May 2008 11:08:04 -0700, "Jim in Arizona"
<ti*******@hotmail.comwrote:
<div style="border-bottom: 4px;
Have you thought about using and ASP Panel here and setting the colour
on the server?
<td valign="top" style="width:40px;"><img
src="<%Response.Write(strLight)%>" align="absmiddle" /></td>
Similarly, use an ASP Image control for the image and Labels for the
messages.
>If AJAX can't handel the Response.Write within the update panel, is there
another way to go about this?
Regards,
Mark
--
|\ _,,,---,,_ A picture used to be worth a
ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
|,4- ) )-,_. ,\ ( `'-' came television!
'---''(_/--' `-'\_)

Mark Stevens (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
Jun 27 '08 #2
Not sure if this is the same problem I had a bit ago, but if you have trace
turned on for the page, Ajax goes insane about it.
"Jim in Arizona" <ti*******@hotmail.comwrote in message
news:eY**************@TK2MSFTNGP06.phx.gbl...
I'm brand new at ajax. In fact, about 20 minutes ago was the first time I
got it to work. The problem I'm having on another page did not work,
however.

I'm running into the following 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(), response filters,
HttpModules, or server trace is enabled.
Details: Error parsing near 'greengreengreengreen'.
This is my code. The strBorder variables is filled with an RGB color
string from the code behind page, ie, the color Green (as noted in the
error message I guess). I'm basically changing the color of a text box
border based on what is being returned from the database. Its a system
status message so if things are going wrong, a little red stop light is
loaded next to the message and the border around the message changes to
red.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="15000"
Enabled="true" OnTick="Timer1_Tick" />

<asp:DataList ID="dlSystemStatus" runat="server" RepeatColumns="1"
Width="100%">
<ItemTemplate>

<div style="border-bottom: 4px;
border-left: 4px;
border-right: 4px;
border-top: 4x;
border-bottom-style: double;
border-left-style: double;
border-right-style: double;
border-top-style: double;
border-bottom-color: <%Response.Write(strBorder) %>;
border-left-color: <%Response.Write(strBorder) %>;
border-right-color: <%Response.Write(strBorder) %>;
border-top-color: <%Response.Write(strBorder) %>;
background-color: White;
margin-right: 5%;
padding:5px;
font-family:Tahoma;font-size:10pt;">

<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="width:40px;"><img
src="<%Response.Write(strLight)%>" align="absmiddle" /></td>
<td valign="top">
<i>Posted By <%# Eval("originator") %>, <%#Eval("jobdesc")%on <%#
Eval("date") %at <%#Eval("time")%></i>
<hr size="2" color="black"/>
<b>Customer Message</b>
<br />
<%# Eval("message") %>
<hr />
<b>Technical Details</b>
<br />
<%#Eval("technical")%>
</td>
</tr>
</table>

</div>

</ItemTemplate>
</asp:DataList>

</ContentTemplate>
</asp:UpdatePanel>

If AJAX can't handel the Response.Write within the update panel, is there
another way to go about this?

TIA,
Jim
Jun 27 '08 #3

"Mark Stevens" <ne***@nospam.nospamwrote in message
news:5j********************************@4ax.com...
On Tue, 6 May 2008 11:08:04 -0700, "Jim in Arizona"
<ti*******@hotmail.comwrote:
><div style="border-bottom: 4px;

Have you thought about using and ASP Panel here and setting the colour
on the server?
><td valign="top" style="width:40px;"><img
src="<%Response.Write(strLight)%>" align="absmiddle" /></td>

Similarly, use an ASP Image control for the image and Labels for the
messages.
>>If AJAX can't handel the Response.Write within the update panel, is there
another way to go about this?

Regards,
Mark
--
|\ _,,,---,,_ A picture used to be worth a
ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
|,4- ) )-,_. ,\ ( `'-' came television!
'---''(_/--' `-'\_)

Mark Stevens (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".


I started to do what you suggested but ran into some problems.
I'm not all that good with asp.net so I do run into some frustrations from
time to time.

The problem here is that I'm using a datalist. Any asp:controls that I place
within the <asp:datalist..element on the aspx page are not recognized when
I try to utilize them in the code behind.

This is a basic datalist object and I am not using any of its 'commands'. In
the past when I had used them, the sub looked like this:

Sub UpdateRequest(ByVal sender As Object, ByVal e As
DataListCommandEventArgs)

The datalistcommandeventargs object allowed me to 'find' the asp item within
the aspx page by doing something like this:

Dim imgSignalLight As New Image
imgSignalLight = e.Item.FindControl("imgSignalLight")

Then I could manipulate the object.

I can't seem to find any other way to fix my current problem. IN my code
behind page, I have a simple sub procedure (method as you C# people like to
call them) that does the database connection and SQL query to fill the
dataset that populates the datalist located on the aspx page. I can't just
at 'e As DataListCommandEventArgs' as a part of the procedure. I tried to
create a DataListCommandEventArgs object within the connection sub routine
but it asked for things I didn't know, ie:

Dim e As DataListCommandEventArgs(item as DataList, commandSource as Object,
originalArgs as CommandEventArgs)

the datalist would be the name of my datalist, I'm assuming, but I can't
figure out what the other objects would be or where they would come from.

So, the point is, is that I can't use any asp.net controls within a datalist
UNLESS they are part of the datalist's standard events, like UpdateCommand,
DeleteCommand, and so on, where I could then reference the objects using the
DataListCommandEventArgs class stated as a paramater within one of these
'Command' events. All I need to do is figure out how to make my own
procedure (method) that works like the Command events that are part of the
datalist control. I actually tried that but then I don't know how to call
the procedure properly, ie:
Sub SystemStatus()
db connection code here
End Sub

into

Sub SystemStatus(ByVal sender As Object, ByVal e As
DataListCommandEventArgs)
....db connection and query code...
Dim imgSignal as Image
imgSignal = e.Item.FindControl("imgSignal")
End Sub

Then, how would I call that sub, say, within the Page_Load routine (or ajax
timer routine)? What would be the 'sender' object that would be a required
paramater, for instance?
Jun 27 '08 #4

"Lucid" <lu***@phreak2000.comwrote in message
news:FB**********************************@microsof t.com...
Not sure if this is the same problem I had a bit ago, but if you have
trace turned on for the page, Ajax goes insane about it.

Well, its worth a try rather than trying to redo all my code.
Is tracing turned on by default because I didn't take any action to turn it
on.
How do you turn it off?

Thanks Lucid.
Jun 27 '08 #5
Hrm, if you didnt turn it on yourself its more than likely not on, but if
you want to check look at the source of the offending page up at the top it
will have trace="true".
"Jim in Arizona" <ti*******@hotmail.comwrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
>
"Lucid" <lu***@phreak2000.comwrote in message
news:FB**********************************@microsof t.com...
>Not sure if this is the same problem I had a bit ago, but if you have
trace turned on for the page, Ajax goes insane about it.


Well, its worth a try rather than trying to redo all my code.
Is tracing turned on by default because I didn't take any action to turn
it on.
How do you turn it off?

Thanks Lucid.
Jun 27 '08 #6
instead of response.write, try: <%=strBorder%>
Jim in Arizona wrote:
I'm brand new at ajax. In fact, about 20 minutes ago was the first time I
got it to work. The problem I'm having on another page did not work,
however.

I'm running into the following 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(), response filters,
HttpModules, or server trace is enabled.
Details: Error parsing near 'greengreengreengreen'.
This is my code. The strBorder variables is filled with an RGB color string
from the code behind page, ie, the color Green (as noted in the error
message I guess). I'm basically changing the color of a text box border
based on what is being returned from the database. Its a system status
message so if things are going wrong, a little red stop light is loaded next
to the message and the border around the message changes to red.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="15000"
Enabled="true" OnTick="Timer1_Tick" />

<asp:DataList ID="dlSystemStatus" runat="server" RepeatColumns="1"
Width="100%">
<ItemTemplate>

<div style="border-bottom: 4px;
border-left: 4px;
border-right: 4px;
border-top: 4x;
border-bottom-style: double;
border-left-style: double;
border-right-style: double;
border-top-style: double;
border-bottom-color: <%Response.Write(strBorder) %>;
border-left-color: <%Response.Write(strBorder) %>;
border-right-color: <%Response.Write(strBorder) %>;
border-top-color: <%Response.Write(strBorder) %>;
background-color: White;
margin-right: 5%;
padding:5px;
font-family:Tahoma;font-size:10pt;">

<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="width:40px;"><img
src="<%Response.Write(strLight)%>" align="absmiddle" /></td>
<td valign="top">
<i>Posted By <%# Eval("originator") %>, <%#Eval("jobdesc")%on <%#
Eval("date") %at <%#Eval("time")%></i>
<hr size="2" color="black"/>
<b>Customer Message</b>
<br />
<%# Eval("message") %>
<hr />
<b>Technical Details</b>
<br />
<%#Eval("technical")%>
</td>
</tr>
</table>

</div>

</ItemTemplate>
</asp:DataList>

</ContentTemplate>
</asp:UpdatePanel>

If AJAX can't handel the Response.Write within the update panel, is there
another way to go about this?

TIA,
Jim

Jun 27 '08 #7
Well damn Bruce! I think you just saved me a lot of time and frustration!
Thanks!
It's often something small, isn't it?
"bruce barker" <no****@nospam.comwrote in message
news:eA****************@TK2MSFTNGP06.phx.gbl...
instead of response.write, try: <%=strBorder%>

Jun 27 '08 #8

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

Similar topics

31
3075
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
4
7447
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
1
1969
by: JWHIT | last post by:
I created a map application which works fine with regular aspx and a meta refresh. I would like to have the map itself update independently using ajax. (Sorry on the long post, I just started...
1
3272
by: Mike P | last post by:
I am trying to apply the Update Progress control to a method that is building a zip file and then giving the user the chance to save the file via a popup box. But the Update Progress control...
1
1203
by: Adeel | last post by:
Hi, i am new to Microsoft Ajax framework. I have created a site using Ajax framework bit after uploading it when i run it it gives me the error: ...
6
5122
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
0
7165
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
1
1439
by: richard | last post by:
We have developed a website using ajax toolkit in asp.net 2.0 During web development everything work fine. When we deploy at live environment, the client is using proxy server. We found out the...
0
7153
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...
0
7373
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
7432
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...
1
7094
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...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3230
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
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 ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.