Wrox Programmer Forums
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services 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, 02:07 PM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

Code:
Response.Write(@"document.writeln(""<html><head></head><body>Hi msman88</body></html>""); ");
On the above I got only the following is printed on the browser:
Code:
     document.writeln("Hi msman88");
I want to print it as string as it appears below:
Code:
     document.writeln("<html><head></head><body>Hi msman88</body></html>");
So, edit the code to do that.

Last edited by msman88; March 4th, 2010 at 02:11 PM..
 
Old March 4th, 2010, 03:08 PM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

Hey! I got it, here it is:
Code:
Response.Write(HttpUtility.HtmlEncode("<html><body>hello msman88</body></html>"));
that will print:
Code:
<html><body>hello msman88</body></html>
 
Old March 5th, 2010, 12:50 PM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

Hey where are you wrox Professionals!
 
Old March 5th, 2010, 01:15 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Please don't post these kind of messages. The best answer you'll ever get is "I am here". They only clutter up the forum. Like Sam said: we do this stuff for fun in our own *free* time. That means if i find your post interesting enough and know the answer, I'l look at it; otherwise I won't.

You're not making it easier for yourself by posting many unrelated messages in the same thread. Other people will see "40 replies", think the thread is already taking care of and move on. So, stick to a simple rule: "new topic == new thread". Choose an apprpriate forum and a descriptive title and post a detailed message.

That way you increase your chances of a reply, minimizing the need to post these kind of useless "where are you" messages.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 5th, 2010, 01:51 PM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

I'm sorry, But the problem is not understood except you run it.
For more care on that, I developed a new app is particularly describing this problem only.
To facilitate understanding the problem by members.
However, I opened a new thread for that again in, and you should solve it.
and tell me if it's in the right place. Problem with "HttpUtility.HtmlEncode()"

Last edited by msman88; March 5th, 2010 at 01:54 PM..
 
Old March 14th, 2010, 01:58 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

It's great that you figured out the answer yourself! Comparing this to the issue you had in the other thread (the HtmlEncode thread), the difference is that, here you encoded html - that's necessary, but in the other thread you encoded javascript - that only causes trouble.

Hope this clears the difference between the two situations.
 
Old March 14th, 2010, 03:03 PM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by PeterPeiGuo View Post
It's great that you figured out the answer yourself! Comparing this to the issue you had in the other thread (the HtmlEncode thread), the difference is that, here you encoded html - that's necessary, but in the other thread you encoded javascript - that only causes trouble.

Hope this clears the difference between the two situations.

I switched to the another thread because the topic became not related with this topic title.





Similar Threads
Thread Thread Starter Forum Replies Last Post
he conversion of a char data type to a datetime data type resulted in an out-of-range adamhw Classic ASP Basics 3 December 23rd, 2009 07:18 AM
Method must have a return type Mr.Rendezvous BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 2 November 25th, 2009 05:21 PM
return type as Form neriam Beginning VB 6 1 August 9th, 2009 02:25 AM
Generic return type mega C# 2005 1 November 30th, 2006 07:27 AM
return type? Sibananda Tripathy J2EE 1 January 3rd, 2005 04:03 AM





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