HowTo Loading ActiveX dinamically at runtime ?

Discussion in 'ASP .Net Web Controls' started by Leo sailer, Apr 27, 2005.

  1. Leo sailer

    Leo sailer Guest

    Hi,
    The point is the following I need to add ActiveX control dinamically in a
    Webform. Currently I'm doing this using a literal control and "writing the
    HTML Code" for example:

    lit.Text = "<OBJECT id=Dtpicker1 name=Dtpicker1 height=24 width=90%
    align=center classid='clsid:20DD1B9E-87C4-11D1-8BE3-0000F8754DA1' " >" & _
    "<PARAM NAME='OLEDropMode' VALUE='0'>" & _
    "<PARAM NAME='CalendarBackColor' VALUE='-2147483643'>" & _
    "<PARAM NAME='CalendarForeColor' VALUE='-2147483630'>" & _
    "<PARAM NAME='CalendarTitleBackColor' VALUE='-2147483633'>" & _
    "<PARAM NAME='CalendarTitleForeColor' VALUE='-2147483630'>" & _
    "<PARAM NAME='CalendarTrailingForeColor' VALUE='-2147483631'>" & _
    "<PARAM NAME='CurrentDate' VALUE='3445565'>" & _
    "<PARAM NAME='UpDown' VALUE='1'>" & _
    "<PARAM NAME='MaxDate' VALUE='2958465'>" & _
    "<PARAM NAME='MinDate' VALUE='-109205'>" & _
    "</OBJECT>"
    controls.add(lit).

    It works but I want something cleaner, such as using AXHost, but that I can
    added as a Web control, for example:

    Dim AxDTPicker as new mscomct2.DateTimepicker

    AxDTPicker.value = '3445565'

    Controls.add(AxDTPicker)

    Is any other way to add ActiveX controls dinamically ?

    Thnaks
    Leo sailer, Apr 27, 2005
    #1
    1. Advertising

  2. Leo sailer

    MasterGaurav Guest

    Why not create a custom control - derive it from Label and make cutom
    elements (for params to the activeX).

    Some example of new properties of the new control can be:
    string CLSID
    string Height
    string Width
    string Align (or Align Align, where Align is enum)
    ParameterList Parameters (this is the list of parameters/values).

    Override the Render method.

    Now, you can host this control as custom control, like:

    <prefix:ActiveXControl ... width=".." clsid="..." runat="server">
    <prefix:parameter name="..." value="..." runat="server"/>
    ...
    </prefix:ActiveXControl>


    --
    Cheers,
    Gaurav Vaish
    http://www.mastergaurav.org
    http://mastergaurav.blogspot.com
    --------------------------------
    MasterGaurav, Apr 28, 2005
    #2
    1. Advertising

  3. Leo sailer

    Leo sailer Guest

    Thanks for answering.
    Create a custom control it is not an option, becuase I have to load several
    Activex, some of them are very complex, migrate is the final idea, but now i
    need to use the ActiveX currently running.

    Thnaks

    "MasterGaurav" wrote:

    > Why not create a custom control - derive it from Label and make cutom
    > elements (for params to the activeX).
    >
    > Some example of new properties of the new control can be:
    > string CLSID
    > string Height
    > string Width
    > string Align (or Align Align, where Align is enum)
    > ParameterList Parameters (this is the list of parameters/values).
    >
    > Override the Render method.
    >
    > Now, you can host this control as custom control, like:
    >
    > <prefix:ActiveXControl ... width=".." clsid="..." runat="server">
    > <prefix:parameter name="..." value="..." runat="server"/>
    > ...
    > </prefix:ActiveXControl>
    >
    >
    > --
    > Cheers,
    > Gaurav Vaish
    > http://www.mastergaurav.org
    > http://mastergaurav.blogspot.com
    > --------------------------------
    >
    >
    Leo sailer, Apr 28, 2005
    #3
  4. Leo sailer

    MasterGaurav Guest

    Ah! Couldn't response earlier.. was travelling.

    Can you please elaborate on "need to use the Activex currently
    running"? What exactly do you mean in this...

    If you have "several complex" activeX, then I think there's no other
    option than the current way. You may like to use Label instead of
    literal text... but anyway, it doesn't matter.

    If you are looking for AXHost for ASP.Net, you'd need to write the
    code. IMHO, nothing is readily available as of now. May be you have a
    look at http://www.asp.net if something is available.


    --
    Cheers,
    Gaurav Vaish
    http://www.mastergaurav.org
    http://mastergaurav.blogspot.com
    --------------------------------
    MasterGaurav, May 5, 2005
    #4
  5. Leo sailer

    Leo sailer Guest

    Thanks,
    What i tried to explain was that the ActiveX are some applications that
    people are accustomed to use them, but they are distribute in different
    portals. I would like to put all in one portal, and add some other .net
    webforms.
    Due to the fact that these ActiVeX are "in production", I'd like, in this
    stage, not to migrate to .Net, but I need to "load them" in a webforms in
    runtime.

    Anyway , thanks for all.

    Talking about AxHost, do you know some links or something to learn about it ?.

    "MasterGaurav" wrote:

    > Ah! Couldn't response earlier.. was travelling.
    >
    > Can you please elaborate on "need to use the Activex currently
    > running"? What exactly do you mean in this...
    >
    > If you have "several complex" activeX, then I think there's no other
    > option than the current way. You may like to use Label instead of
    > literal text... but anyway, it doesn't matter.
    >
    > If you are looking for AXHost for ASP.Net, you'd need to write the
    > code. IMHO, nothing is readily available as of now. May be you have a
    > look at http://www.asp.net if something is available.
    >
    >
    > --
    > Cheers,
    > Gaurav Vaish
    > http://www.mastergaurav.org
    > http://mastergaurav.blogspot.com
    > --------------------------------
    >
    >
    Leo sailer, May 5, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ann
    Replies:
    0
    Views:
    689
  2. =?Utf-8?B?am9zZXBt?=

    loading dinamically webforms

    =?Utf-8?B?am9zZXBt?=, Oct 7, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    389
    Scott Allen
    Oct 7, 2005
  3. Replies:
    0
    Views:
    872
  4. vml
    Replies:
    0
    Views:
    1,033
  5. spallared

    Dinamically loading an image into a iframe

    spallared, Apr 26, 2007, in forum: Javascript
    Replies:
    1
    Views:
    111
    shimmyshack
    Apr 26, 2007
Loading...

Share This Page