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

M

Miguel Dias Moura

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
 
H

Hans Kesting

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top