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. Accessing activeX in ASPX from C#

Accessing activeX in ASPX from C#

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomhardware
5 Posts 3 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.
  • P Offline
    P Offline
    pankajdaga
    wrote on last edited by
    #1

    Hi everyone, I have an ActiveX control embedded in an ASP.NET page as follows: What I would like to know is call an exposed method on this control from the C# code behind the ASPX page. However, I do not know how I can access the object from the C# code. I tried things like: myControl1.Method() but I cannot access the myControl1 variable from the code. Thanks, Pankaj /** I'm the one who's gonna have to die When it's time for me to die So let me live my life The way I want to - Jimi Hendrix */

    A 1 Reply Last reply
    0
    • P pankajdaga

      Hi everyone, I have an ActiveX control embedded in an ASP.NET page as follows: What I would like to know is call an exposed method on this control from the C# code behind the ASPX page. However, I do not know how I can access the object from the C# code. I tried things like: myControl1.Method() but I cannot access the myControl1 variable from the code. Thanks, Pankaj /** I'm the one who's gonna have to die When it's time for me to die So let me live my life The way I want to - Jimi Hendrix */

      A Offline
      A Offline
      Alvaro Mendez
      wrote on last edited by
      #2

      The one thing that stands out right away is that you're missing the runat="server" attribute. After you add it, be sure to switch to Design view so VS.NET writes the proper code-behind. Regards, Alvaro


      You know what they say about arguing over the Internet...

      P 1 Reply Last reply
      0
      • A Alvaro Mendez

        The one thing that stands out right away is that you're missing the runat="server" attribute. After you add it, be sure to switch to Design view so VS.NET writes the proper code-behind. Regards, Alvaro


        You know what they say about arguing over the Internet...

        P Offline
        P Offline
        pankajdaga
        wrote on last edited by
        #3

        Hi Alvaro, Thanks for the reply. Even when I have this: I do not get an instance of the object in the C# code. VS.NET does not create a C# instance automatically... Thanks, Pankaj /** I'm the one who's gonna have to die When it's time for me to die So let me live my life The way I want to - Jimi Hendrix */

        A T 2 Replies Last reply
        0
        • P pankajdaga

          Hi Alvaro, Thanks for the reply. Even when I have this: I do not get an instance of the object in the C# code. VS.NET does not create a C# instance automatically... Thanks, Pankaj /** I'm the one who's gonna have to die When it's time for me to die So let me live my life The way I want to - Jimi Hendrix */

          A Offline
          A Offline
          Alvaro Mendez
          wrote on last edited by
          #4

          Wait a minute, you're just adding a User Control to your page? Why do it this way? :confused: Regards, Alvaro


          You know what they say about arguing over the Internet...

          1 Reply Last reply
          0
          • P pankajdaga

            Hi Alvaro, Thanks for the reply. Even when I have this: I do not get an instance of the object in the C# code. VS.NET does not create a C# instance automatically... Thanks, Pankaj /** I'm the one who's gonna have to die When it's time for me to die So let me live my life The way I want to - Jimi Hendrix */

            T Offline
            T Offline
            TheSnakeByte
            wrote on last edited by
            #5

            as far as I know either VS.NET or I are stupid. you want to use that instance in your code-behind? afaik this doesn't work. you'll have to put a <% code... %> part into the html that fires onload or whenever if that's not what you've meant, sorry, I don't get it :p so long.

            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