Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old March 31st, 2010, 10:07 AM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
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.
Reply With Quote
  #12 (permalink)  
Old March 31st, 2010, 10:15 AM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2008
Location: Tareem, Hadramout, Yemen.
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#
Reply With Quote
  #13 (permalink)  
Old March 31st, 2010, 10:26 AM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
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.
Reply With Quote
  #14 (permalink)  
Old March 31st, 2010, 10:31 AM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2008
Location: Tareem, Hadramout, Yemen.
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#
Reply With Quote
  #15 (permalink)  
Old March 31st, 2010, 10:37 AM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
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>
Reply With Quote
  #16 (permalink)  
Old March 31st, 2010, 10:43 AM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2008
Location: Tareem, Hadramout, Yemen.
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#
Reply With Quote
  #17 (permalink)  
Old April 1st, 2010, 09:55 AM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:55 PM
New Line String Constant Paula222 Access VBA 2 February 8th, 2006 11:36 AM



All times are GMT -4. The time now is 06:22 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.