473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
Nov 15 '05 #1
2 1417
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.

"neverstill" <sk************@yahoo.com> wrote in message
news:u6****************@TK2MSFTNGP11.phx.gbl...
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

Nov 15 '05 #2
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 :)
"Marina" <so*****@nospam.com> wrote in message
news:ub****************@TK2MSFTNGP09.phx.gbl...
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.

"neverstill" <sk************@yahoo.com> wrote in message
news:u6****************@TK2MSFTNGP11.phx.gbl...
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


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ron Bullman | last post by:
Hi, I havent been able to find any documentation about @ in the CodeDom context. The problem is when generating C# code from CodeDom it will associate a @-tag with all C# specific types. Why?...
2
by: Guillaume | last post by:
I don't think I'm the only one with this challenge so… I made code with the CodeDom classes and made code to create a new solution and a new project Now I want to get the codedom code in the new...
1
by: John Livermore | last post by:
Hello, We have an application that uses CodeDom for dynamic in-memory compilation of code. The same code (library) is used by both an ASP.net web site and a Windows Service. The code runs fine...
3
by: Alexey Lavnikov | last post by:
I'm playing with CodeDOM and CSharpCodeProvider. I've found the following possibilities: CodeDOM -> Assembly C# Source code -> Assembly I miss the C# Source code -> CodeDOM only. Is it there?...
5
by: BuddyWork | last post by:
Hello, Can CodeDom be used to read an existing CS file.
9
by: lee.chappers | last post by:
How can I make the CodeDom generate the following C# method? protected sealed override void Test() { } I've tried using: domMethod.Attributes = MemberAttributes.Override |...
2
by: JT | last post by:
Sorry if my frustration shows through in this. I have seen posts and discussions dating back to 2001 and still haven't seen any "good" example of a tutorial on CodeDOM. I've seen very many that...
6
by: moondaddy | last post by:
will CodeDom create XAML windows or just regular windows forms? If so, how to I tell it to create a xaml window instead of a windows form? thanks -- moondaddy@noemail.noemail
1
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
I may have painted myself into a corner with GenerateInMemory=true. My app need a custom user step. Users want to code (sort of - they are not programmers) some refinements to a search...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.