Wrox Programmer Forums
|
BOOK: Professional Web 2.0 Programming
This is the forum to discuss the Wrox book Professional Web 2.0 Programming by Eric van der Vlist, Danny Ayers, Erik Bruchez, Joe Fawcett, Alessandro Vernet; ISBN: 9780470087886
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Web 2.0 Programming 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 31st, 2010, 10:07 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

What is the problem? On C# side? On javascript side? Please provide the exact testing code you used and the exact error message you saw. Also tell me what browser (and version number) you used to test.

Once you send to me those, I will help you find out the exact issue.
 
Old March 31st, 2010, 10:15 AM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

This works fine:
Code:
Response.Write(@"msman88 is\
        Abdul-Rhman");
and this does not woork
Code:
Response.ContentType = "text/javascript";
        Response.Write(@"document.write('hello \
                world')");
I mean by work is that output is satisfiable, please try it out.
browser: any browser.
__________________
ASP.NET & C#
 
Old March 31st, 2010, 10:26 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

When you said that the second piece of code didn't work, what was your observation? what was the issue?

You realize that your second piece of code is just one line of javascript, what you expect in the browser should be this string:'document.write("foo");' but not this string: "foo". (You expect the javascript as it is, but don't expect the result from the execution of the script.)

Let's make sure we expect the same thing.
 
Old March 31st, 2010, 10:31 AM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

What I want to do is that making "new line in constant" I mean in the string of Response.write. and that purpose is to nest the code.
I use "@" to make that and worked fine but only without the line
Code:
Response.ContentType = "text/javascript";
and when having that line, the "@" is stopping it's job.
__________________
ASP.NET & C#
 
Old March 31st, 2010, 10:37 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Do you expect hello and world show up on two separate lines when the message pop up? If so, take a look at the following:
Code:
<html>
<head>
<script type="text/javascript">
function a() {
alert("hello\r\nworld");
}
</script>
</head>
<body>
<input type="button" onclick="a()">
</body>
</html>
 
Old March 31st, 2010, 10:43 AM
Authorized User
 
Join Date: Feb 2008
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

The purpose of javascript is not a pop up, but is just plain text represents a javascript code that's is used by another pages, or in other hand, that javascript code is referred by other pages that uses javascript, (it's an advertisement network) and that javascript is is ads called by publisher pages.
__________________
ASP.NET & C#
 
Old April 1st, 2010, 09:55 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Let's go back to the white board, and get to the bottom of this. There are better ways.

Piece together this thread and couple other threads that you created recently. What you are doing is to generate a javascript from one ASP.Net page, then have a second ASP.net consume this generated javascript, right? You try to insert new lines into the generated script, I guess, for the purpose to make it more human readable.

Maybe it is unintentional, but you actually use javascript as way of passing data from the first ASP.net page to the second one That is not the right way, and it complicates things for you.

There are many other ways of passing data around: session, cookie ... You need give more thought to your design.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue using "saxon:line-number()" in command line XSL with Saxon9.jar ROCXY XSLT 3 June 3rd, 2009 04:24 AM
How to draw indicator line in owc line chart AlexOo General .NET 0 July 9th, 2007 10:32 PM
How to read file line by line in EVC++ iriskab Visual C++ 0 September 27th, 2006 01:39 PM
Reading line by line from a .txt file x_ray VB.NET 2002/2003 Basics 5 February 10th, 2006 01:55 PM
New Line String Constant Paula222 Access VBA 2 February 8th, 2006 12:36 PM





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