You can also insert it into a block of JavaScript which is added to the page
using RegisterClientScriptBlock, etc. Or, you can put a LiteralControl into
the hard-coded JavaScript in a Page (if you have hard-coded JavaScript in
the Page_, and set the Text property of the LiteralControl.
The most dynamic but difficult method is to create an HttpHandler to handle
requests for .js files, have the HttpHandler dynamically generate the .js
file, and reference it as an external script in the Page. This is almost
never necessary, and because it is complicated, should be avoided if not
necessary.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"bruce barker" <no****@nospam.comwrote in message
news:eC**************@TK2MSFTNGP03.phx.gbl...
the easiest is to put the text into a hidden field.
<script runat=server>
Page.ClientScript.RegisterHiddenField("fileText",g etFileText());
</script>
<script>
alert(document.getElementById('fileText').value);
</script>
-- bruce (sqlwork.com)
JimHeavey wrote:
>Thanks Kevin.
Yes, it is a server side file.
I was not quite sure how to "inject" the text into the page.
So I open up a reader and read all the text into variable XX. Now how do
I set the javascript variable FF to the value which I have in XX? That
was the real point of my confusion, although you did confirm that
javascript will not read server side files.