Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I know this question will make me look like a complete idiot to all of you, but client side internet programming is so new to me....

 

 

So, here's the question :

 

How do I use a script written in a js file ? I tried puting it in the html within <script> tags with src="myfile.js".... doesn't work.

But it works fine if the page is a plain html file.

 

If would like to use it in the server side in the Load event. I would test the IsPostBack and then register the script. Is it possible ?

Now go on, boy, and pay attention. Because if you do, someday, you may achieve something that we Simpsons have dreamed about for generations: You may outsmart someone!

--Homer Simpson

  • Moderators
Posted

If you want to register it on the server (side) then "<script> tags with src="myfile.js".... " is useless.

 

You would need to read the js file as you would any other file and then use RegisterClientScriptBlock to assign the streaming string.

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...