Accessing activeX in ASPX from C#
-
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 */
-
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 */
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
-
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
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 */
-
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 */
Wait a minute, you're just adding a User Control to your page? Why do it this way? :confused: Regards, Alvaro
-
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 */
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.