Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

Register Javascript File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 16 Apr 2008 01:53 GMT
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 - 16 Apr 2008 15:20 GMT
> Hello,
>
[quoted text clipped - 6 lines]
> Thanks,
> Miguel

You want this, I think:

http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.regis
terclientscriptblock.aspx

Mick Wilson - 16 Apr 2008 15:26 GMT
> 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();"
wisccal@googlemail.com - 17 Apr 2008 11:21 GMT
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

> Hello,
>
[quoted text clipped - 6 lines]
> Thanks,
> Miguel

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.