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
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 .
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.
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.)
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.
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.
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.