Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Register Javascript File

0 views
Skip to first unread message

shapper

unread,
Apr 15, 2008, 8:53:39 PM4/15/08
to
Hello,

I want to register the JQuery Javascript file at runtime in my Page's
VB code.

Do I need or should I to do this using ScriptManger? If not, how can I
do it?

Thanks,
Miguel

Mick Wilson

unread,
Apr 16, 2008, 10:20:19 AM4/16/08
to

Mick Wilson

unread,
Apr 16, 2008, 10:26:53 AM4/16/08
to
> You want this, I think:
>
> http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptma...

To elaborate (since I accidentally hit send), you can use the first
method listed on that page to register your script, and then set the
client onClick attribute (for example) to call a method from the
script.

Me.Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "chkAll",
stringOfJavaScript)

later on in the code...

Dim cbHeader As CheckBox = [...]
cbHeader.Attributes("onclick") = "MyJavaScriptFunction();"

wis...@googlemail.com

unread,
Apr 17, 2008, 6:21:15 AM4/17/08
to
In addition to what Mick suggested, I would also recommend you check
out the ClientScriptManager's RegisterClientScriptInclude method.
Since you want to include the file dynamically, using the
ClientScriptManager's methods is, I believe, the only route to go.

==========
Regards,
Steve
www.stkomp.com

0 new messages