如何RegisterStartupScript JS.file [英] how to RegisterStartupScript JS.file
本文介绍了如何RegisterStartupScript JS.file的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用用户控件。
我需要使用Js文件,我想知道如何使用<加载js文件br />
来自用户控件的RegisterStartupScript命令。
另外,如果我在同一网页中多次加载相同的用户控件,请执行
我必须检查js文件是否仍然被加载?
Stan
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
推荐答案
也许这样可行:
RegisterStartupScript(someVariable," script
language =''javascript'''src =''yourInclude.js''/>")
欢呼,
mortb
Stan Sainte-Rose < ST ** @ cyber972.com>在消息中写道
news:%2 *************** @ tk2msftngp13.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...
<我正在处理一个用户控件。
我需要使用一个Js文件,我想知道如何使用来自用户控件的RegisterStartupScript命令加载js文件
。
另外,如果我在同一个网页中多次加载相同的用户控件,
我是否必须检查js文件是否仍然加载?
Stan
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
你好Mortb
我试过你所说的......但它对我不起作用。
别忘了,我想在用户控件中使用它。
Stan
" mortb" <莫**** @ hotmail.com> écritdansle message de news:
#w ************* @ TK2MSFTNGP09.phx.gbl ...
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...
也许这个会工作:
RegisterStartupScript(someVariable," script
language =''javascript'''src =''yourInclude.js''/>")
>欢呼,
mortb
Stan Sainte-Rose < ST ** @ cyber972.com>在消息中写道
新闻:%2 *************** @ tk2msftngp13.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...
我我正在使用一个用户控件。
我需要使用一个Js文件,我想知道如何使用来自用户控件的
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命令加载js文件。
另外,如果我在同一个
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same
网页中多次加载相同的用户控件,请执行
webpage, do
我必须检查js文件是否是仍然加载?
Stan
I have to check if the js file is still loaded ?
Stan
请务必发送启动脚本从您的用户控件到基页...类似于:
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''/>&quo t;)
如果不是basePage.IsClientScriptBlockRegistered(ScriptNameA sString)那么basePage.RegisterClientScriptBlock(ScriptNameAsStr ing,strScript.ToString)
" mortb" <莫**** @ hotmail.com>在消息新闻中写道:%2 *************** @ TK2MSFTNGP09.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...
也许这样可行:
RegisterStartupScript( someVariable,< script
language =''javascript'''src =''yourInclude.js''/>")
欢呼,
mortb
Stan Sainte-Rose < ST ** @ cyber972.com>在消息中写道
新闻:%2 *************** @ tk2msftngp13.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...
我我正在使用一个用户控件。
我需要使用一个Js文件,我想知道如何使用
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
从以下命令加载js文件
using
用户控件。
另外,如果我在同一个网页中多次加载相同的用户控件,
RegisterStartupScript command from the user control.
Also, if I load the same user controls several times in the same webpage,
做
我必须检查js文件是否是还在装吗?
Stan
I have to check if the js file is still loaded ?
Stan
这篇关于如何RegisterStartupScript JS.file的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文