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. Calling Java function on page load [modified]

Calling Java function on page load [modified]

Scheduled Pinned Locked Moved ASP.NET
java
3 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.
  • D Offline
    D Offline
    DineshSharma
    wrote on last edited by
    #1

    Hi Frends I wanna call a java function on page load event on my .aspx.cs page and want to pass some values from there....but its not working.....:confused: I am doing like this.... this.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)"); not working actually i need to call this java function on page load so i can use it like but i cant pass the values from my .cs page is there any way to pass the value from .cs page :confused: Dinesh Sharma -- modified at 3:59 Saturday 19th August, 2006

    Dinesh Sharma

    G 1 Reply Last reply
    0
    • D DineshSharma

      Hi Frends I wanna call a java function on page load event on my .aspx.cs page and want to pass some values from there....but its not working.....:confused: I am doing like this.... this.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)"); not working actually i need to call this java function on page load so i can use it like but i cant pass the values from my .cs page is there any way to pass the value from .cs page :confused: Dinesh Sharma -- modified at 3:59 Saturday 19th August, 2006

      Dinesh Sharma

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

      Don't write whole sentences in bold. It serves no purpose other than making it harder to read. What you are using is not Java at all, it's Javascript.

      DineshSharma wrote:

      this.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)"); not working

      Standard question #1: What do you mean by "not working"? The Page object (that "this" references to) is the page itself, not a control on the page, so you can't add attributes to it. So I assume that the error message is that the object doesn't have any "Attributes" property. Put an id on the body tag and make it a server tag, so that you can access it from code behind: <body id="Body" runat="server"> Now you can declare the reference and put the call to the Javascript in the onload event: protected HtmlGenericControl Body; Body.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)");

      --- b { font-weight: normal; }

      D 1 Reply Last reply
      0
      • G Guffa

        Don't write whole sentences in bold. It serves no purpose other than making it harder to read. What you are using is not Java at all, it's Javascript.

        DineshSharma wrote:

        this.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)"); not working

        Standard question #1: What do you mean by "not working"? The Page object (that "this" references to) is the page itself, not a control on the page, so you can't add attributes to it. So I assume that the error message is that the object doesn't have any "Attributes" property. Put an id on the body tag and make it a server tag, so that you can access it from code behind: <body id="Body" runat="server"> Now you can declare the reference and put the call to the Javascript in the onload event: protected HtmlGenericControl Body; Body.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)");

        --- b { font-weight: normal; }

        D Offline
        D Offline
        DineshSharma
        wrote on last edited by
        #3

        Hi guffa thanks for your great help.....Now I am able to do this :cool:. Thanks :)

        Dinesh Sharma

        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