Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2008 > C# 2008 aka C# 3.0
|
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 4th, 2010, 08:07 AM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Exclamation using @ in response.write();

I want to print the following:
document.writeln("<html><body>Hi msman88</body></html>”);


But I have error when coding it like this:
Response.write(@” document.writeln(\"<html><body>Hi msman88</body></html>\”); ”);
 
Old March 4th, 2010, 08:12 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspx
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old March 4th, 2010, 10:55 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default verbatim string literal

With verbatim string literal, you don't use \ to escape - as a matter of fact, you don't escape anything other than " itself, in which case you use "". So you should do this:
Code:
Response.write(@” document.writeln(""<html><body>Hi msman88</body></html>"”); ”);





Similar Threads
Thread Thread Starter Forum Replies Last Post
response.write(hyperlink) adolphus ASP.NET 1.0 and 1.1 Basics 7 September 11th, 2006 03:05 AM
response.write crmpicco Classic ASP Basics 1 January 27th, 2005 06:31 PM
response.write netcrawler Classic ASP Databases 4 September 29th, 2004 10:13 AM
Response.write Sach Classic ASP Components 5 March 19th, 2004 06:40 AM
Response.Write an SSI hcweb Classic ASP Basics 2 November 2nd, 2003 05:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.