By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

active-x controls with runat="server"

P: n/a
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
ma**********@NOSPAM.bytronic.com
(delete NOSPAM. to email)
Nov 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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
ma**********@NOSPAM.bytronic.com
(delete NOSPAM. to email)

Nov 19 '05 #2

P: n/a
"Patrick" <Pa*****@discussions.microsoft.com> wrote in message
news:<B1**********************************@microso ft.com>...
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
Nov 19 '05 #3

P: n/a


"Martin Eyles" wrote:
"Patrick" <Pa*****@discussions.microsoft.com> wrote in message
news:<B1**********************************@microso ft.com>...
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

Nov 19 '05 #4

P: n/a
"Patrick" <Pa*****@discussions.microsoft.com> wrote:
"Martin Eyles" wrote:
"Patrick" <Pa*****@discussions.microsoft.com> 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
ma**********@NOSPAM.bytronic.com
Nov 19 '05 #5

P: n/a
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" <ma**********@NOSPAM.bytronic.com> wrote in message news:<11************@corp.supernews.com>...
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

Nov 19 '05 #6

P: n/a
"Daniel Roth" <da********@gmail.com> wrote in message
news:71**************************@posting.google.c om...
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
ma**********@NOSPAM.bytronic.com
Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.