Can't run COM control as a server control.

K

Ken Varn

I added a TDC COM control to my ASP.NET web page. For some reason in Visual
Studio, I cannot get it to set the control to run as a server control. Can
someone explain if this is a bug or if there is some other reason why this
cannot be performed. I specifically want to be able to set some attributes
and Params on the server side before it is rendered.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
 
B

bruce barker

There is no builtin <object> or <params> control. if you add a runat=server,
they are handled by the html generic control. you have a couple of options.

set the runat on the <param>

aspx:

<object id=foo .... runat=server>
<param name=param1 id=param1 runat=server>
</object>

codebehind:

//update declared param

param1.Attributes.Add("Value","myvalue");

//add dynamic param

HtmlGenericControl param = new HtmlGenericControl ("param");
param.TagName="param2";
param.Attributes.Add("Value","myvalue2");
foo.Controls.Add(param);

// set objects innerhtml dynamically

foo.InnerHtml = "<param name='param1' value='myvalue'><param name='param2'
value='myvalue2'>";


-- bruce (sqlwork.com)



"Ken Varn" <nospam> wrote in message
| I added a TDC COM control to my ASP.NET web page. For some reason in
Visual
| Studio, I cannot get it to set the control to run as a server control.
Can
| someone explain if this is a bug or if there is some other reason why this
| cannot be performed. I specifically want to be able to set some
attributes
| and Params on the server side before it is rendered.
|
| --
| -----------------------------------
| Ken Varn
| Senior Software Engineer
| Diebold Inc.
|
| EmailID = varnk
| Domain = Diebold.com
| -----------------------------------
|
|
 
K

Ken Varn

Thanks for the reply!

I wasn't sure if I could just arbitrarily set the runat=server argument on
the object control. I have added other generic html controls and I could
always right click on it and select "run as server control" and Visual
Studio would go ahead and add the appropriate runat command and
corresponding code behind. I wasn't sure why it would not do this for the
<object> tag.



--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
 

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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top