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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. JavaScript
  4. Integer by reference

Integer by reference

Scheduled Pinned Locked Moved JavaScript
tutorialcsharpjavascripthtmlhardware
4 Posts 3 Posters 10 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.
  • V Offline
    V Offline
    vhassan
    wrote on last edited by
    #1

    Dear Experts! I have any object with classid embedded in html. That object exposes a method with take C# reference (ref) parameter integer. I want to call that method using javascript.

    var refInt = 0;
    document.getElementById("myObject").GetReferenceInt(ref refInt);
    alert(refInt);

    Please tell me how I can get that. I have seen ref is a keyword in JavaScript. Can't find any solution for this. Please guide how to use object if this is not appropriate. Thank you.

    N 1 Reply Last reply
    0
    • V vhassan

      Dear Experts! I have any object with classid embedded in html. That object exposes a method with take C# reference (ref) parameter integer. I want to call that method using javascript.

      var refInt = 0;
      document.getElementById("myObject").GetReferenceInt(ref refInt);
      alert(refInt);

      Please tell me how I can get that. I have seen ref is a keyword in JavaScript. Can't find any solution for this. Please guide how to use object if this is not appropriate. Thank you.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      AKAIK ref is not a keyword in JavaScript. If GetReferenceInt is a C# method it cannot be called in this manner. You would need to use something like PageMethods or other AJAX methods to obtain the value and even then you cannot use a ref parameter.


      I know the language. I've read a book. - _Madmatt

      V 1 Reply Last reply
      0
      • N Not Active

        AKAIK ref is not a keyword in JavaScript. If GetReferenceInt is a C# method it cannot be called in this manner. You would need to use something like PageMethods or other AJAX methods to obtain the value and even then you cannot use a ref parameter.


        I know the language. I've read a book. - _Madmatt

        V Offline
        V Offline
        vhassan
        wrote on last edited by
        #3

        Thank you. Please guide me about PageMethods or AJAX method you are referring. I am stuck on this particular situation :(

        Y 1 Reply Last reply
        0
        • V vhassan

          Thank you. Please guide me about PageMethods or AJAX method you are referring. I am stuck on this particular situation :(

          Y Offline
          Y Offline
          Yusuf
          wrote on last edited by
          #4

          see here for pagemethodshttp://blogs.microsoft.co.il/blogs/gilf/archive/2008/10/04/asp-net-ajax-pagemethods.aspx[^] and this one http://blog.waleedmohamed.net/2009/12/calling-code-behind-function-in-java.html[^]

          Yusuf May I help you?

          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