quote error in response.write

  • Thread starter Thread starter Luke Davis
  • Start date Start date
L

Luke Davis

I can't figure this out, why am I getting ")" expected and ";" expected on
this line?

Response.Write("<input type=""hidden"" name=""item_number"" value="".COM,
MLSNumber"">");


- L
 
Simply, you're stopping a string with the first doublequote and then
starting it again with the second. Two double-quotes together don't mean
anything. What you need is the escape sequence which, if memory serves me
correctly, is \"

Response.Write("<input type=\"hidden\" name=\"item_number\" value=\".COM,
MLSNumber\">");
 
This is giving me a " 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 '<input type="hidden"'.

This is the script, it's running inside of an update panel , any ideas?



<%

if (TextBox1.Text == "tom")

{

Response.Write("<input type=\"hidden\" name=\"amount\" value=\"19.95\">");

Response.Write("<input type=\"hidden\" name=\"item_number\" value=\".COM,
MLSNumber\">");


}

else

{

Response.Write("<input type=\"hidden\" name=\"amount\" value=\"14.95\">");

Response.Write("<input type=\"hidden\" name=\"item_number\" value=\".INFO,
MLSNumber\">");

}

%>
 
Luke said:
This is giving me a " 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 '<input type="hidden"'.

This is the script, it's running inside of an update panel , any ideas?

8< snip
Response.Write("<input type=\"hidden\" name=\"amount\" value=\"19.95\">");

8< snip

All elements in xhtml has to be terminated. Put a / before the ending >
in the tag.
 
Back
Top