473,395 Members | 1,987 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,395 software developers and data experts.

How to load a Javascript file in Asp.Net 2.0?

Hello,

I have MyPage.aspx created from a master page.
I want to load the MyPage.js with javascript functions.
How can I load this file in my runtime code, i.e., MyPage.aspx.vb?

I am working in Asp.Net 2.0.

Thank You,
Miguel

Feb 22 '06 #1
2 1005

try
Page.ClientScript.RegisterClientScriptBlock(....);

http://msdn2.microsoft.com/en-us/lib...riptblock.aspx

R-)

"Miguel Dias Moura" <md*REMOVE*moura@gmail*NOSPAM*.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
Hello,

I have MyPage.aspx created from a master page.
I want to load the MyPage.js with javascript functions.
How can I load this file in my runtime code, i.e., MyPage.aspx.vb?

I am working in Asp.Net 2.0.

Thank You,
Miguel

Feb 22 '06 #2
> Hello,

I have MyPage.aspx created from a master page.
I want to load the MyPage.js with javascript functions.
How can I load this file in my runtime code, i.e., MyPage.aspx.vb?

I am working in Asp.Net 2.0.

Thank You,
Miguel


Where do you want to use that javascript? You can't use it server-side,
so why load it there?
To include this file in the client-side HTML, use something like

Page.RegisterClientScriptBlock("js", "<script
src='MyPage.js'></script>")

Hans Kesting
Feb 22 '06 #3

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

Similar topics

1
by: jen_designs | last post by:
Can you load 2 xml files on an html page via javascript? I can get one xml file to load, using the following code. How about two. I need to combine 2 xmls files on the client. Any other way to...
6
by: acord | last post by:
Hi, In a html page, I don't know how to load in a php page from javascript. I've already defined a <div id="treemenu"> in the html page. The executed content from the php script is supposed...
5
by: amit | last post by:
Hello, the javascript I'm using is not embedded into HTML but included. When I looking at w3schools.com it uses examples with js embedded into html. Anyway, when I use: function load() {...
4
by: Aquosus | last post by:
I would like to know how to load images from a file using JavaScript. path = = root/images/kitchens/web all files are jpeg I would like to be able to loop through the file and capture all...
3
by: robudo | last post by:
Hello, I need some help to solve the following problem. I wrote some html/javascript code to read data from an XML file: XML file: <places> <place year="2000" name="Amsterdam" /> <place...
1
by: charlie imac | last post by:
I have a question on the capability of Ajax. My question is: Is it possible to dynamically load any of the javascript gallery programs such as: Adobe Spry Gallery SmoothGallery others I...
2
by: ray | last post by:
I have a html file stored as the D:/proj/test.html. In the html file I wish to load a javascript file---test.js which is stored in the same directory as test.html. <!DOCTYPE HTML PUBLIC...
3
by: Sunny | last post by:
Hi, Can someone tell me, How to load the Body Html from a text file that contains javascript. to Manage my files I am creating an Index Page. <html> <head> <meta http-equiv="content-type"...
5
by: memiller | last post by:
I know this generally not recommended, but I'm working in the confines of the company's intranet. Goal: permit managers to load an XML file from thier PC into an intranet ASP.NET webpage where...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
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...

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.