active-x controls with runat="server"

Discussion in 'ASP .Net' started by Martin Eyles, Apr 21, 2005.

  1. Martin Eyles

    Martin Eyles Guest

    Hi,

    I have a page that contains the following

    <div runat="server" id="Pikea">
    <object runat="server" id="PiTV" style="width:560px; height:560px"
    classid="clsid:{3DF152A5-521D-4330-A8DC-1424CEB66BAA}" VIEWASTEXT>
    </object>
    </div>

    This all worked beautifully without the runat="server", but as soon as I
    added that, it started comming up with the error

    Parser Error Message: Guid should contain 32 digits with 4 dashes
    (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

    Does anyone know what is causing this, and how to fix it?

    Thanks,
    Martin

    --
    Martin Eyles

    (delete NOSPAM. to email)
    Martin Eyles, Apr 21, 2005
    #1
    1. Advertising

  2. Hi Martin,

    I'm afraid this won't work. It seems that the ASPX-Parser recognizes this
    tag as a Server object. You can define object-instances this way, I GUESS. At
    least "Windows Script Components" use it the way.

    Create your own control and you're done.

    Regards
    Patrick

    "Martin Eyles" wrote:

    > Hi,
    >
    > I have a page that contains the following
    >
    > <div runat="server" id="Pikea">
    > <object runat="server" id="PiTV" style="width:560px; height:560px"
    > classid="clsid:{3DF152A5-521D-4330-A8DC-1424CEB66BAA}" VIEWASTEXT>
    > </object>
    > </div>
    >
    > This all worked beautifully without the runat="server", but as soon as I
    > added that, it started comming up with the error
    >
    > Parser Error Message: Guid should contain 32 digits with 4 dashes
    > (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
    >
    > Does anyone know what is causing this, and how to fix it?
    >
    > Thanks,
    > Martin
    >
    > --
    > Martin Eyles
    >
    > (delete NOSPAM. to email)
    >
    >
    >
    =?Utf-8?B?UGF0cmljaw==?=, Apr 21, 2005
    #2
    1. Advertising

  3. Martin Eyles

    Martin Eyles Guest

    "Patrick" <> wrote in message
    news:<>...

    > Hi Martin,


    >


    > I'm afraid this won't work. It seems that the ASPX-Parser recognizes this


    > tag as a Server object.


    Ok. If I take out the runat, can I reference it via the <div runat="server"
    id="Pikea">

    i.e. is there something in Pikea.controls I can use?

    > You can define object-instances this way, I GUESS. At


    > least "Windows Script Components" use it the way.


    >


    > Create your own control and you're done.


    Sorry, don't understand what you mean. The control I am using is an ActiveX
    control that I already have, and it is being added client side. All I want
    to add server side is the <param> tags.

    Thanks,

    Martin
    Martin Eyles, Apr 21, 2005
    #3
  4. "Martin Eyles" wrote:

    > "Patrick" <> wrote in message
    > news:<>...
    >
    > > Hi Martin,

    >
    > >

    >
    > > I'm afraid this won't work. It seems that the ASPX-Parser recognizes this

    >
    > > tag as a Server object.

    >
    > Ok. If I take out the runat, can I reference it via the <div runat="server"
    > id="Pikea">


    You can acces the div, but not the child-controls. The ASPX-parser will add
    a Literalcontrol for all text between the <div runat="server" ...> and
    </div>. Not single controls for each param.

    >
    > i.e. is there something in Pikea.controls I can use?
    >
    > > You can define object-instances this way, I GUESS. At

    >
    > > least "Windows Script Components" use it the way.

    >
    > >

    >
    > > Create your own control and you're done.

    >
    > Sorry, don't understand what you mean. The control I am using is an ActiveX
    > control that I already have, and it is being added client side. All I want
    > to add server side is the <param> tags.


    You should write a Server-Control, which renders a <object>-tag on the
    client-side. There you can specify all <param>-tags needed for your object.

    >
    > Thanks,
    >
    > Martin
    >
    >
    >
    =?Utf-8?B?UGF0cmljaw==?=, Apr 21, 2005
    #4
  5. Martin Eyles

    Martin Eyles Guest

    "Patrick" <> wrote:
    > "Martin Eyles" wrote:
    > > "Patrick" <> wrote:
    > >
    > > > I'm afraid this won't work. It seems that the ASPX-Parser recognizes

    this
    > >
    > > > tag as a Server object.

    > >
    > > Ok. If I take out the runat, can I reference it via the <div

    runat="server"
    > > id="Pikea">

    >
    > You can acces the div, but not the child-controls. The ASPX-parser will

    add
    > a Literalcontrol for all text between the <div runat="server" ...> and
    > </div>. Not single controls for each param.
    >
    > > i.e. is there something in Pikea.controls I can use?
    > >
    > > > You can define object-instances this way, I GUESS. At

    > >
    > > > least "Windows Script Components" use it the way.

    > >
    > > > Create your own control and you're done.

    > >
    > > Sorry, don't understand what you mean. The control I am using is an

    ActiveX
    > > control that I already have, and it is being added client side. All I

    want
    > > to add server side is the <param> tags.

    >
    > You should write a Server-Control, which renders a <object>-tag on the
    > client-side. There you can specify all <param>-tags needed for your

    object.

    I took out the object tag, leaving just the div tag, and have added this
    code to the page's .cs file.

    System.Web.UI.HtmlControls.HtmlGenericControl PiTV;
    PiTV=new System.Web.UI.HtmlControls.HtmlGenericControl();
    PiTV.TagName="object";
    PiTV.ID="PiTV";
    PiTV.Attributes.Add("classid","clsid:{3DF152A5-521D-4330-A8DC-1424CEB66BAA}"
    );
    PiTV.Style.Add("width","560px");
    PiTV.Style.Add("height","560px");
    Pikea.Controls.Add(PiTV);

    When you say to put it in a server control, do you mean an .ascx file? What
    are the benefits of doing this, over doing the above?

    Thanks,
    Martin

    --
    Martin Eyles
    Martin Eyles, Apr 21, 2005
    #5
  6. Martin Eyles

    Daniel Roth Guest

    Hi

    Use classid="{3DF152A5-521D-4330-A8DC-1424CEB66BAA}" or
    classid="3DF152A5-521D-4330-A8DC-1424CEB66BAA" not
    classid="clsid:{3DF152A5-521D-4330-A8DC-1424CEB66BAA}"

    Regards,

    Daniel Roth
    MCSD.NET




    "Martin Eyles" <> wrote in message news:<>...
    > Hi,
    >
    > I have a page that contains the following
    >
    > <div runat="server" id="Pikea">
    > <object runat="server" id="PiTV" style="width:560px; height:560px"
    > classid="clsid:{3DF152A5-521D-4330-A8DC-1424CEB66BAA}" VIEWASTEXT>
    > </object>
    > </div>
    >
    > This all worked beautifully without the runat="server", but as soon as I
    > added that, it started comming up with the error
    >
    > Parser Error Message: Guid should contain 32 digits with 4 dashes
    > (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
    >
    > Does anyone know what is causing this, and how to fix it?
    >
    > Thanks,
    > Martin
    Daniel Roth, Apr 22, 2005
    #6
  7. Martin Eyles

    Martin Eyles Guest

    "Daniel Roth" <> wrote in message
    news:...
    > Hi
    >
    > Use classid="{3DF152A5-521D-4330-A8DC-1424CEB66BAA}" or
    > classid="3DF152A5-521D-4330-A8DC-1424CEB66BAA" not
    > classid="clsid:{3DF152A5-521D-4330-A8DC-1424CEB66BAA}"
    >
    > Regards,
    >
    > Daniel Roth
    > MCSD.NET


    This does NOT work. The error goes away, but so does the
    <object.......></object> in the output html.

    To see what I used as the final solution, look at my last reply to patrick
    in this thread.

    Cheers,
    ME

    --
    Martin Eyles
    Martin Eyles, Apr 25, 2005
    #7
    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. Hazzard
    Replies:
    2
    Views:
    534
    Yan-Hong Huang[MSFT]
    Jul 23, 2003
  2. Marina
    Replies:
    0
    Views:
    528
    Marina
    Jul 21, 2003
  3. Erland
    Replies:
    4
    Views:
    1,548
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=
    Oct 14, 2006
  4. Replies:
    0
    Views:
    619
  5. Van den Driessche Willy

    Customer controls runat="server"

    Van den Driessche Willy, May 15, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    109
    Van den Driessche Willy
    May 15, 2006
Loading...

Share This Page