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. can't get RegisterStartupScript with src=path\filename to work

can't get RegisterStartupScript with src=path\filename to work

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
2 Posts 1 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.
  • D Offline
    D Offline
    dd314159
    wrote on last edited by
    #1

    this.page.ClientScript.RegisterStartupScript(this.GetType(), "cpjs", "");

    and I have all the javascript functions I need in wcpjs.js. However I get object not found errors. If I replace the src=" ...." part with a test function like "function test(){alert('i hate javascript');}" then no problem no error. I have tried using src=\" differentpath\\wcpjs.js\" but to no avail. Still get errors. Have spent a full day on this now and am :confused::mad: X| If anyone can answer this - when I get rich I'll send you some big bucks.

    D 1 Reply Last reply
    0
    • D dd314159

      this.page.ClientScript.RegisterStartupScript(this.GetType(), "cpjs", "");

      and I have all the javascript functions I need in wcpjs.js. However I get object not found errors. If I replace the src=" ...." part with a test function like "function test(){alert('i hate javascript');}" then no problem no error. I have tried using src=\" differentpath\\wcpjs.js\" but to no avail. Still get errors. Have spent a full day on this now and am :confused::mad: X| If anyone can answer this - when I get rich I'll send you some big bucks.

      D Offline
      D Offline
      dd314159
      wrote on last edited by
      #2

      this is the line of code - some got cut off.

      this.page.ClientScript.RegisterStartupScript(this.GetType(), "cpjs", "<script type=\"text/javascript\" src=\"wcpjs.js\" >");

      thanks.

      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