473,699 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

way to inject javascript?

Is there a way to inject a large javascript function into an asp.net page, in
1.1 and 2.0?
Nov 26 '06 #1
2 1591
Hi,

ChrisA wrote:
Is there a way to inject a large javascript function into an asp.net page, in
1.1 and 2.0?
The best way remains using external JavaScript files, and including the
file using a <scripttag:

<script type="text/javascript" src="myFile.js" ></script>

The script files can also be embedded in a DLL, using an embedded
resource and the webresource.axd handler.

http://www.nikhilk.net/WebResourceAttribute.aspx

If the script needs to be dynamically modified, then you have to use the
RegisterClientS criptBlock method (in the Page class for ASP.NET 1.1, and
in the ClientScriptMan ager for ASP.NET 2.0), but it is to be avoided
especially for big functions, because then it won't be cached, but sent
to the client on every request.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 26 '06 #2
Thanks very much
Nov 26 '06 #3

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

Similar topics

2
2479
by: tvmaly | last post by:
Due to the restrictions I have at my host, I cannot use smtplib in my email cgi script. They gave me a script they use that calls nullmailer-inject. I am trying to figure out how to add the ability to send attachments via the nullmailer-inject call. I could not find much documentation on google about nullmailer. Has anyone used it before to send attachments? Here is function I have so far that sends a regular email. The variables...
5
6202
by: Nim | last post by:
HI, I would like to know if it's possible inject a dll (create with c++) into an application with c# like c++, and which instruction use c# for do this
0
1752
by: Fabien Penso | last post by:
Hi. I am looking for the proper way to fetch a webpage, inject javascript and run an IE component on it. I've been looking around with no luck. For now I thought about: 1. fetch the webpage with a webrequest 2. make modifications (I would prefer to have access to the DOM) 3. run an IE component on the new source
3
12871
by: Angel | last post by:
Hi, I have a page which shows a matrix of names and grades for given period. All the grades fields must be editable and they can be up to 200 fields (20 students with 10 grades each) Since there are a lots of fields I do not want to go back and forth to validate entered values on any change. I decided that this may be achieved with some JavaScript functions to validate some controls and to calculate average and total values of other...
1
1471
by: sklett | last post by:
I want to implement a simple form element focus script that will change the color of a form element when it gets focus and revert back when it loses focus. I've got the code working (simple) but now I need to add it to ALL my form controls and there are tons. Is there a way to override page rendering and insert the javascript into the rendered page source? For example, this is what I would like to add to my controls:...
2
4909
by: Kris | last post by:
Problem with getting data out of injected script template.html contains the following html and is located at http://example.com/template.html: <html> <head> <title></title> </head> <body>
7
3760
by: gnewsgroup | last post by:
OK, I am still trying to achieve something like what is shown in the following PNG image. http://farm3.static.flickr.com/2066/1808692173_ea202973a3_o.png I thought about doing this with a plain Table server control, but the problem is that this control does not provide enough events for us to identify the row in which the button is clicked. See a discussion I initiated in the following thread:
1
3489
by: =?Utf-8?B?SkhpbGJDUk0=?= | last post by:
I am trying to write a httpmodule to inject javascript includes on some of the aspx pages we have. For instance, I want to inject into the resulting IIS response something like... response.Write("<script language='javascript'>"); response.Write("alert('tt');"); response.Write(@"</script>");
5
5138
by: jeffos101 | last post by:
Hi, I am trying to do the following and would like to know if it's possible using Javascript/Ajax/and some DB I have an Iframe hosted on one server that loads a page which is located on another server. So mydomain.com is in the browser address bar and loads PageA (from Mydomain2.com). Page A contains a form and a submit button. I need to Inject some data from the Db into one or several fields contained in the Form on PageA. And...
0
8689
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8885
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7752
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.