codeDOM... is this a good use for it?

  • Thread starter Thread starter neverstill
  • Start date Start date
N

neverstill

Hi-

I am developing an asp.net application. I have a bunch of client script
that I need to place in a page. Right now I'm doing it like this:
StringWriter cs= new StringWriter();
cs.WriteLine("<script language=\"javascript\">");

etc, etc.

it is a real pain. I was thinking... is it possible(and appropriate) to use
the codeDom to read from a .js file in my project and dump the contents to a
string, then I could pass the string to a Literal control?

It seems like it would make sense, but I'm not sure where to start and can't
really find much in the way of codeDOM examples or how to access files in a
project rather that using the filesystem and the full path.

If anyone has any hints, I would love to hear them!

Thanks,
Steve
 
Why not just read the contents of the file, and dump it out into the literal
control? We are talking about client side script, right? I don't think
codedom would even be able to deal with that.
 
Because I don't want to have the overhead of reading a file at runtime. I
would rather read it an compile time and have it as a variable.
I'm not sure if it's possible either. But it seems like it should be(I
hope)

Thanks for the quick response :)
 
Back
Top