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. breaking out into server code while rendering javascript

breaking out into server code while rendering javascript

Scheduled Pinned Locked Moved ASP.NET
javascripthtmlwpfwcfadobe
4 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.
  • G Offline
    G Offline
    Guy Harwood
    wrote on last edited by
    #1

    Im writing a page that contains a data repeater. within the repeaters item template i go into javascript and declare an SWFObject (this is a javascript helper class for writing out flash videos onto the page). I need to pass the SWFObject some data from the item that is binding to the repeater (see the bold code bit below). If i try this... //<![CDATA[ var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8"); so.addVariable("thumbURL",'video_clicker.jpg'); so.addVariable("videoURL",'<b><%# Container.DataItem("VideoURL") %></b>');</code> it simply does not work as it wont break into the ASP like it does with the HTML. Does anyone know/understand a way around this? Regards, Guy </x-turndown>

    M 2 Replies Last reply
    0
    • G Guy Harwood

      Im writing a page that contains a data repeater. within the repeaters item template i go into javascript and declare an SWFObject (this is a javascript helper class for writing out flash videos onto the page). I need to pass the SWFObject some data from the item that is binding to the repeater (see the bold code bit below). If i try this... //<![CDATA[ var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8"); so.addVariable("thumbURL",'video_clicker.jpg'); so.addVariable("videoURL",'<b><%# Container.DataItem("VideoURL") %></b>');</code> it simply does not work as it wont break into the ASP like it does with the HTML. Does anyone know/understand a way around this? Regards, Guy </x-turndown>

      M Offline
      M Offline
      MoustafaS
      wrote on last edited by
      #2

      Just make an external method in javascript that takes the url as input and processes it like: function DeclareSWF(url) var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8"); so.addVariable("thumbURL",'video_clicker.jpg'); so.addVariable("videoURL",url); And in the server code just call it : DeclareSWF('<%# Container.DataItem("VideoURL") %>')


      About : Islam
      About : Me

      1 Reply Last reply
      0
      • G Guy Harwood

        Im writing a page that contains a data repeater. within the repeaters item template i go into javascript and declare an SWFObject (this is a javascript helper class for writing out flash videos onto the page). I need to pass the SWFObject some data from the item that is binding to the repeater (see the bold code bit below). If i try this... //<![CDATA[ var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8"); so.addVariable("thumbURL",'video_clicker.jpg'); so.addVariable("videoURL",'<b><%# Container.DataItem("VideoURL") %></b>');</code> it simply does not work as it wont break into the ASP like it does with the HTML. Does anyone know/understand a way around this? Regards, Guy </x-turndown>

        M Offline
        M Offline
        MoustafaS
        wrote on last edited by
        #3

        Just make an external method in javascript that takes the url as input and processes it like: function DeclareSWF(url) var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8"); so.addVariable("thumbURL",'video_clicker.jpg'); so.addVariable("videoURL",url); And in the server code just call it : DeclareSWF('<%# Container.DataItem("VideoURL") %>') About : Islam About : Me

        G 1 Reply Last reply
        0
        • M MoustafaS

          Just make an external method in javascript that takes the url as input and processes it like: function DeclareSWF(url) var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8"); so.addVariable("thumbURL",'video_clicker.jpg'); so.addVariable("videoURL",url); And in the server code just call it : DeclareSWF('<%# Container.DataItem("VideoURL") %>') About : Islam About : Me

          G Offline
          G Offline
          Guy Harwood
          wrote on last edited by
          #4

          but that doesnt solve my problem because you still have to call the javascript and pass a server side variable. Ive already setup the function in the head of the aspx page but in my repeater i have to break into a script block to call 'DeclareSWF'. How do you suggest i do that? Because in the 6 years ive been doing asp.net if never figured it out! :doh: Regards, Guy

          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