Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Custom control with client-side script

Custom control with client-side script

Scheduled Pinned Locked Moved ASP.NET
asp-netcsharpjavascripthtmltools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrGlover
    wrote on last edited by
    #1

    I am making a super duper custom web control with fancy client-side script. In keeping with the ASP.Net model I have decided to put my client-side script into a js file and store it with the ASP.Net ones in \aspnet_client\system_web\[version]\... I could write the HTML to include this file as part of the render process, but then I will have multiple references to the same file. Is there some way I can register with ASP.Net that I have a client-side script file to be linked like it does for it's own client-side script files? Gracias JBoy

    U 1 Reply Last reply
    0
    • M MrGlover

      I am making a super duper custom web control with fancy client-side script. In keeping with the ASP.Net model I have decided to put my client-side script into a js file and store it with the ASP.Net ones in \aspnet_client\system_web\[version]\... I could write the HTML to include this file as part of the render process, but then I will have multiple references to the same file. Is there some way I can register with ASP.Net that I have a client-side script file to be linked like it does for it's own client-side script files? Gracias JBoy

      U Offline
      U Offline
      User 146350
      wrote on last edited by
      #2

      Hello, Don't understand much about your question. But I guess that you want to add a link to your .js file just only once. You can use the method Page.RegisterClientScriptBlock(key as string, htmltext as string) in the function OnPreRender().

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups