active-x controls with runat="server"

M

Martin Eyles

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
 
G

Guest

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
 
M

Martin Eyles

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
 
G

Guest

Martin Eyles said:
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
i.e. is there something in Pikea.controls I can use?



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
 
M

Martin Eyles

Patrick said:
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


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
 
D

Daniel Roth

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
 
M

Martin Eyles

Daniel Roth said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top