473,474 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to RegisterStartupScript JS.file

Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file using
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same webpage, do
I have to check if the js file is still loaded ?

Stan
Nov 18 '05 #1
11 3628
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file using RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same webpage, do I have to check if the js file is still loaded ?

Stan

Nov 18 '05 #2
Hi Mortb

I ve tried what you've said.. but it doesn't work for me.
Do not forget, I would like to use this within a user control.
Stan

"mortb" <mo****@hotmail.com> a écrit dans le message de news:
#w*************@TK2MSFTNGP09.phx.gbl...
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file using
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same

webpage, do
I have to check if the js file is still loaded ?

Stan


Nov 18 '05 #3
Be sure to send the startup script to the base page from your user control ... something like:

Dim strScript As New System.Text.StringBuilder()
Dim basePage As Page = Me.Page
Dim ScriptNameAsString as String = "SCRIPTNAME"

strScript.Append("<script language='javascript'´src='yourInclude.js' />")

If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString)

"mortb" <mo****@hotmail.com> wrote in message news:%2***************@TK2MSFTNGP09.phx.gbl...
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file

using
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same webpage,

do
I have to check if the js file is still loaded ?

Stan


Nov 18 '05 #4
Hi Thomas,

It sounds good.. I ve just a little problem.
I see the <script language='javascript' src='yourInclude.js'> comes inside
the <Form>
and my page has lost its design.
How could I get this tag outside the <form> tag ?

Thanks.

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
#1**************@TK2MSFTNGP15.phx.gbl...
Be sure to send the startup script to the base page from your user control
.... something like:

Dim strScript As New System.Text.StringBuilder()
Dim basePage As Page = Me.Page
Dim ScriptNameAsString as String = "SCRIPTNAME"

strScript.Append("<script language='javascript'´src='yourInclude.js' />")

If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString)

"mortb" <mo****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file

using
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same webpage,

do
I have to check if the js file is still loaded ?

Stan


Nov 18 '05 #5
I think that is a function of the Page methods that register scripts - that is they are designed to place the text in the form tags ...

RegisterClientScriptBlock - The client-side script is emitted just after the opening tag of the Page object's <form runat= server> element.The script block is emitted as the object that renders the output is defined, so you must include both tags of the <script> element.

RegisterStartupScript - Similar to the RegisterClientScriptBlock method, this method emits the script just before the closing tag of the Page object's <form runat= server> element. The script block is emitted as the object that renders the page is defined, so you must include both tags of the <script> element.


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message news:en**************@TK2MSFTNGP11.phx.gbl...
Hi Thomas,

It sounds good.. I ve just a little problem.
I see the <script language='javascript' src='yourInclude.js'> comes inside
the <Form>
and my page has lost its design.
How could I get this tag outside the <form> tag ?

Thanks.

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
#1**************@TK2MSFTNGP15.phx.gbl...
Be sure to send the startup script to the base page from your user control
... something like:

Dim strScript As New System.Text.StringBuilder()
Dim basePage As Page = Me.Page
Dim ScriptNameAsString as String = "SCRIPTNAME"

strScript.Append("<script language='javascript'´src='yourInclude.js' />")

If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString)

"mortb" <mo****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file

using
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same webpage,

do
I have to check if the js file is still loaded ?

Stan



Nov 18 '05 #6
Yes,

I use
If Not basePage.IsStartupScriptRegistered(ScriptNameAsStr ing) Then
basePage.RegisterStartupScript(ScriptNameAsString, strScript.ToString)

But, when a function is called from my form it doesn't find the javascript
function :-(

If I use the your example, it works fine but as I said it breaks my design..

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
eU**************@TK2MSFTNGP09.phx.gbl...

I think that is a function of the Page methods that register scripts - that
is they are designed to place the text in the form tags ...

RegisterClientScriptBlock - The client-side script is emitted just after the
opening tag of the Page object's <form runat= server> element.The script
block is emitted as the object that renders the output is defined, so you
must include both tags of the <script> element.

RegisterStartupScript - Similar to the RegisterClientScriptBlock method,
this method emits the script just before the closing tag of the Page
object's <form runat= server> element. The script block is emitted as the
object that renders the page is defined, so you must include both tags of
the <script> element.


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
Hi Thomas,

It sounds good.. I ve just a little problem.
I see the <script language='javascript' src='yourInclude.js'> comes inside
the <Form>
and my page has lost its design.
How could I get this tag outside the <form> tag ?

Thanks.

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
#1**************@TK2MSFTNGP15.phx.gbl...
Be sure to send the startup script to the base page from your user control
... something like:

Dim strScript As New System.Text.StringBuilder()
Dim basePage As Page = Me.Page
Dim ScriptNameAsString as String = "SCRIPTNAME"

strScript.Append("<script language='javascript'´src='yourInclude.js' />")

If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString)

"mortb" <mo****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file

using
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same
webpage, do
I have to check if the js file is still loaded ?

Stan



Nov 18 '05 #7
Ok, I ve found the problem.
It's strScript.Append("<script language='javascript'
src='myjsfile.js'></script>")
and not
strScript.Append("<script language='javascript' src='myjsfile.js'/>")

and it works fine with
If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString)

Thanks

Stan

"Stan Sainte-Rose" <st**@cyber972.com> a écrit dans le message de news:
ed**************@TK2MSFTNGP15.phx.gbl...
Yes,

I use
If Not basePage.IsStartupScriptRegistered(ScriptNameAsStr ing) Then
basePage.RegisterStartupScript(ScriptNameAsString, strScript.ToString)

But, when a function is called from my form it doesn't find the javascript
function :-(

If I use the your example, it works fine but as I said it breaks my design..
Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
eU**************@TK2MSFTNGP09.phx.gbl...

I think that is a function of the Page methods that register scripts - that is they are designed to place the text in the form tags ...

RegisterClientScriptBlock - The client-side script is emitted just after the opening tag of the Page object's <form runat= server> element.The script
block is emitted as the object that renders the output is defined, so you
must include both tags of the <script> element.

RegisterStartupScript - Similar to the RegisterClientScriptBlock method,
this method emits the script just before the closing tag of the Page
object's <form runat= server> element. The script block is emitted as the
object that renders the page is defined, so you must include both tags of
the <script> element.


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
Hi Thomas,

It sounds good.. I ve just a little problem.
I see the <script language='javascript' src='yourInclude.js'> comes inside
the <Form>
and my page has lost its design.
How could I get this tag outside the <form> tag ?

Thanks.

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news: #1**************@TK2MSFTNGP15.phx.gbl...
Be sure to send the startup script to the base page from your user control ... something like:

Dim strScript As New System.Text.StringBuilder()
Dim basePage As Page = Me.Page
Dim ScriptNameAsString as String = "SCRIPTNAME"

strScript.Append("<script language='javascript'´src='yourInclude.js' />")
If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString)
"mortb" <mo****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file
using
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same

webpage, do
I have to check if the js file is still loaded ?

Stan



Nov 18 '05 #8
using RegisterStartupScript implies that you will be calling that script
from a client generated event... how are you using it?
"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:ed****************@TK2MSFTNGP15.phx.gbl...
Yes,

I use
If Not basePage.IsStartupScriptRegistered(ScriptNameAsStr ing) Then
basePage.RegisterStartupScript(ScriptNameAsString, strScript.ToString)

But, when a function is called from my form it doesn't find the javascript
function :-(

If I use the your example, it works fine but as I said it breaks my
design..

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
eU**************@TK2MSFTNGP09.phx.gbl...

I think that is a function of the Page methods that register scripts -
that
is they are designed to place the text in the form tags ...

RegisterClientScriptBlock - The client-side script is emitted just after
the
opening tag of the Page object's <form runat= server> element.The script
block is emitted as the object that renders the output is defined, so you
must include both tags of the <script> element.

RegisterStartupScript - Similar to the RegisterClientScriptBlock method,
this method emits the script just before the closing tag of the Page
object's <form runat= server> element. The script block is emitted as the
object that renders the page is defined, so you must include both tags of
the <script> element.


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
Hi Thomas,

It sounds good.. I ve just a little problem.
I see the <script language='javascript' src='yourInclude.js'> comes
inside
the <Form>
and my page has lost its design.
How could I get this tag outside the <form> tag ?

Thanks.

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
#1**************@TK2MSFTNGP15.phx.gbl...
Be sure to send the startup script to the base page from your user
control
... something like:

Dim strScript As New System.Text.StringBuilder()
Dim basePage As Page = Me.Page
Dim ScriptNameAsString as String = "SCRIPTNAME"

strScript.Append("<script language='javascript'´src='yourInclude.js' />")

If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing,
strScript.ToString)

"mortb" <mo****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi,
I m working on a user control.
I need to use a Js file, I would like to know how to load the js file
using
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same webpage, do
I have to check if the js file is still loaded ?

Stan



Nov 18 '05 #9
I haven't ever used the <script ... /> syntax ... I merely copied something
from a previous post ... my apologies ...
"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
Ok, I ve found the problem.
It's strScript.Append("<script language='javascript'
src='myjsfile.js'></script>")
and not
strScript.Append("<script language='javascript' src='myjsfile.js'/>")

and it works fine with
If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString)

Thanks

Stan

"Stan Sainte-Rose" <st**@cyber972.com> a écrit dans le message de news:
ed**************@TK2MSFTNGP15.phx.gbl...
Yes,

I use
If Not basePage.IsStartupScriptRegistered(ScriptNameAsStr ing) Then
basePage.RegisterStartupScript(ScriptNameAsString, strScript.ToString)

But, when a function is called from my form it doesn't find the
javascript
function :-(

If I use the your example, it works fine but as I said it breaks my

design..

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
eU**************@TK2MSFTNGP09.phx.gbl...

I think that is a function of the Page methods that register scripts -

that
is they are designed to place the text in the form tags ...

RegisterClientScriptBlock - The client-side script is emitted just after

the
opening tag of the Page object's <form runat= server> element.The script
block is emitted as the object that renders the output is defined, so you
must include both tags of the <script> element.

RegisterStartupScript - Similar to the RegisterClientScriptBlock method,
this method emits the script just before the closing tag of the Page
object's <form runat= server> element. The script block is emitted as the
object that renders the page is defined, so you must include both tags of
the <script> element.


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
> Hi Thomas,
>
> It sounds good.. I ve just a little problem.
> I see the <script language='javascript' src='yourInclude.js'> comes inside > the <Form>
> and my page has lost its design.
> How could I get this tag outside the <form> tag ?
>
> Thanks.
>
> Stan
>
> "Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news: > #1**************@TK2MSFTNGP15.phx.gbl...
> Be sure to send the startup script to the base page from your user control > ... something like:
>
> Dim strScript As New System.Text.StringBuilder()
> Dim basePage As Page = Me.Page
> Dim ScriptNameAsString as String = "SCRIPTNAME"
>
> strScript.Append("<script language='javascript'´src='yourInclude.js' />") >
> If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
> basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString) >
> "mortb" <mo****@hotmail.com> wrote in message
> news:%2***************@TK2MSFTNGP09.phx.gbl...
>> Maybe this would work:
>> RegisterStartupScript(someVariable,"<script
>> language='javascript'´src='yourInclude.js' />")
>>
>> cheers,
>> mortb
>>
>> "Stan Sainte-Rose" <st**@cyber972.com> wrote in message
>> news:%2***************@tk2msftngp13.phx.gbl...
>>> Hi,
>>> I m working on a user control.
>>> I need to use a Js file, I would like to know how to load the js file
>> using
>>> RegisterStartupScript command from the user control.
>>> Also, if I load the same user controls several times in the same

webpage,
>> do
>>> I have to check if the js file is still loaded ?
>>>
>>> Stan
>>>
>>>
>>
>>
>
>



Nov 18 '05 #10
yes..
I use something like this :
Saisie.Attributes("onblur") = "TypeChamps(this,'" & Row("TypeTest") & "');"
"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
#H*************@TK2MSFTNGP12.phx.gbl...
using RegisterStartupScript implies that you will be calling that script
from a client generated event... how are you using it?
"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:ed****************@TK2MSFTNGP15.phx.gbl...
Yes,

I use
If Not basePage.IsStartupScriptRegistered(ScriptNameAsStr ing) Then
basePage.RegisterStartupScript(ScriptNameAsString, strScript.ToString)

But, when a function is called from my form it doesn't find the javascript function :-(

If I use the your example, it works fine but as I said it breaks my
design..

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news: eU**************@TK2MSFTNGP09.phx.gbl...

I think that is a function of the Page methods that register scripts -
that
is they are designed to place the text in the form tags ...

RegisterClientScriptBlock - The client-side script is emitted just after
the
opening tag of the Page object's <form runat= server> element.The script
block is emitted as the object that renders the output is defined, so you must include both tags of the <script> element.

RegisterStartupScript - Similar to the RegisterClientScriptBlock method,
this method emits the script just before the closing tag of the Page
object's <form runat= server> element. The script block is emitted as the object that renders the page is defined, so you must include both tags of the <script> element.


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
Hi Thomas,

It sounds good.. I ve just a little problem.
I see the <script language='javascript' src='yourInclude.js'> comes
inside
the <Form>
and my page has lost its design.
How could I get this tag outside the <form> tag ?

Thanks.

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news: #1**************@TK2MSFTNGP15.phx.gbl...
Be sure to send the startup script to the base page from your user
control
... something like:

Dim strScript As New System.Text.StringBuilder()
Dim basePage As Page = Me.Page
Dim ScriptNameAsString as String = "SCRIPTNAME"

strScript.Append("<script language='javascript'´src='yourInclude.js' />")
If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing,
strScript.ToString)

"mortb" <mo****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Maybe this would work:
RegisterStartupScript(someVariable,"<script
language='javascript'´src='yourInclude.js' />")

cheers,
mortb

"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
> Hi,
> I m working on a user control.
> I need to use a Js file, I would like to know how to load the js file
using
> RegisterStartupScript command from the user control.
> Also, if I load the same user controls several times in the same

webpage,
do
> I have to check if the js file is still loaded ?
>
> Stan
>
>



Nov 18 '05 #11
no problem :)
"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news:
ee*************@TK2MSFTNGP12.phx.gbl...
I haven't ever used the <script ... /> syntax ... I merely copied something from a previous post ... my apologies ...
"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
Ok, I ve found the problem.
It's strScript.Append("<script language='javascript'
src='myjsfile.js'></script>")
and not
strScript.Append("<script language='javascript' src='myjsfile.js'/>")

and it works fine with
If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then
basePage.RegisterClientScriptBlock(ScriptNameAsStr ing, strScript.ToString)
Thanks

Stan

"Stan Sainte-Rose" <st**@cyber972.com> a écrit dans le message de news:
ed**************@TK2MSFTNGP15.phx.gbl...
Yes,

I use
If Not basePage.IsStartupScriptRegistered(ScriptNameAsStr ing) Then
basePage.RegisterStartupScript(ScriptNameAsString, strScript.ToString)

But, when a function is called from my form it doesn't find the
javascript
function :-(

If I use the your example, it works fine but as I said it breaks my

design..

Stan

"Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de news: eU**************@TK2MSFTNGP09.phx.gbl...

I think that is a function of the Page methods that register scripts -

that
is they are designed to place the text in the form tags ...

RegisterClientScriptBlock - The client-side script is emitted just after
the
opening tag of the Page object's <form runat= server> element.The

script block is emitted as the object that renders the output is defined, so you must include both tags of the <script> element.

RegisterStartupScript - Similar to the RegisterClientScriptBlock method, this method emits the script just before the closing tag of the Page
object's <form runat= server> element. The script block is emitted as the object that renders the page is defined, so you must include both tags of the <script> element.


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
> Hi Thomas,
>
> It sounds good.. I ve just a little problem.
> I see the <script language='javascript' src='yourInclude.js'> comes

inside
> the <Form>
> and my page has lost its design.
> How could I get this tag outside the <form> tag ?
>
> Thanks.
>
> Stan
>
> "Thomas Dodds" <th*********@hotmail.com> a écrit dans le message de

news:
> #1**************@TK2MSFTNGP15.phx.gbl...
> Be sure to send the startup script to the base page from your user

control
> ... something like:
>
> Dim strScript As New System.Text.StringBuilder()
> Dim basePage As Page = Me.Page
> Dim ScriptNameAsString as String = "SCRIPTNAME"
>
> strScript.Append("<script language='javascript'´src='yourInclude.js'

/>")
>
> If Not basePage.IsClientScriptBlockRegistered(ScriptNameA sString) Then > basePage.RegisterClientScriptBlock(ScriptNameAsStr ing,

strScript.ToString)
>
> "mortb" <mo****@hotmail.com> wrote in message
> news:%2***************@TK2MSFTNGP09.phx.gbl...
>> Maybe this would work:
>> RegisterStartupScript(someVariable,"<script
>> language='javascript'´src='yourInclude.js' />")
>>
>> cheers,
>> mortb
>>
>> "Stan Sainte-Rose" <st**@cyber972.com> wrote in message
>> news:%2***************@tk2msftngp13.phx.gbl...
>>> Hi,
>>> I m working on a user control.
>>> I need to use a Js file, I would like to know how to load the js file >> using
>>> RegisterStartupScript command from the user control.
>>> Also, if I load the same user controls several times in the same
webpage,
>> do
>>> I have to check if the js file is still loaded ?
>>>
>>> Stan
>>>
>>>
>>
>>
>
>



Nov 18 '05 #12

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

Similar topics

3
by: Mike P | last post by:
Is there a difference between Page.RegisterClientScriptBlock and Page.RegisterStartupScript? I've seen them both in code examples and they both seem to be doing the same thing. Any help would...
6
by: Bill Jones | last post by:
I'm trying to use this.RegisterStartupScript to add some javascript to and aspx page that will run when the page is loaded. Does anyone know if this function only works in the Page_Load function? ...
2
by: Guadala Harry | last post by:
I have a frameset aspx page that enables users to upload photos. One frame/page shows a thumbnail list of prevously-uploaded images, and the other frame/page includes the controls that enable...
0
by: rom | last post by:
my main aspx page has 3 user controls. they are all located in the same place of the page and each time i set the visibility of 2 of them to false and 1 to true. now, i want to use the...
4
by: Joseph Burton | last post by:
When I put this code in my load function it works just fine. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load RegisterStartupScript("",...
4
by: klynn | last post by:
In my Page_Load I call a RegisterStartupScript. I know its getting called. Yet, its not opening the page. I tried to open a regular .html file as well. Same problem. I know I can open 1. popup...
7
by: sck10 | last post by:
Hello, I have the following sub in a class in my "App_Code" directory. The script is for setting focus on a particular control, but I get the error, "Name ClientScript Not declared". Also, I am...
3
by: MJP | last post by:
I have a button which kicks off the generation of a report after which the file will be downloaded. The report generation can take a long time, so client side onclick event of the button also...
3
by: Rob | last post by:
Hi, We've developed an ajax enabled web app which we're currently deploying to our production server. We use System.Web.UI.Page.RegisterStartupScript throughout the app, and all has worked well...
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
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
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...
1
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
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.