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. Javascript within UserControl

Javascript within UserControl

Scheduled Pinned Locked Moved ASP.NET
helpjavascripttoolsquestion
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.
  • C Offline
    C Offline
    ccotton333
    wrote on last edited by
    #1

    Hey guys, I have a web app that uses UserControls. I need to be able to run a javascript function when that UserControl is loaded. The problem I'm having is this when I had the script on a webform, I could run it onBodyLoad, but UserControls don't have body section. So does anyone know how I could call a javascript function on load of the UserControl? Thanks for all your help, Chris Cotton

    G 1 Reply Last reply
    0
    • C ccotton333

      Hey guys, I have a web app that uses UserControls. I need to be able to run a javascript function when that UserControl is loaded. The problem I'm having is this when I had the script on a webform, I could run it onBodyLoad, but UserControls don't have body section. So does anyone know how I could call a javascript function on load of the UserControl? Thanks for all your help, Chris Cotton

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      User RegisterStartupScript: Page.RegisterStartupScript("NameOfTheScript", "alert('There can be only one.');"); --- b { font-weight: normal; }

      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