Object tag in web form

pisoftwar

Newcomer
Joined
Feb 22, 2004
Messages
6
Ok this is my first attempt at dot net
First I am trying to create a web page to view a camera's picture

I have a OCX that works fine in VB6
When I load the OCX in dot net I get an Object Tag on the webform.aspx page, When I run it I get the image correctly.

I put a image button on the page and opened the webform.aspx.vb code window so I could send the camera
instructions.

When I look for the object, I cannot find it??

How do I get a reference to the OCX/Object on the webform?
 
You need to add the attribute runat="server" to the tag that
defines the control on the web page. Then VS.NET should
automatically create a declaration for the control in the code-behind
page. If it does not, you can always declare it manually.
 
How do Ido it manually.
I just checked it and it says run at server

This is what I get when i drop the control on the form

<OBJECT id="CameraBox" style="Z-INDEX: 101; LEFT: 8px; WIDTH: 319px; POSITION: absolute; TOP: 5px; HEIGHT: 287px" classid="clsid:C79D3167-6133-4E7C-821C-5C114611022D" VIEWASTEXT>
<PARAM NAME="URL" VALUE="">
<PARAM NAME="PTZControlURL" VALUE="">
<PARAM NAME="image_pan_tilt" VALUE="">
<PARAM NAME="Stretch" VALUE="0">
<PARAM NAME="SoundURL" VALUE="">
<PARAM NAME="RecordSoundURL" VALUE="">
<PARAM NAME="AudioParameterURL" VALUE="">
<PARAM NAME="DisplaySoundPanel" VALUE="0">
<PARAM NAME="ReceiveAudio" VALUE="">
<PARAM NAME="TransmitAudio" VALUE="">
<PARAM NAME="AudioConnectionType" VALUE="UNLIMITED">
<PARAM NAME="Reconnect" VALUE="">
</OBJECT>

I need to talk to the property "image_pan_tilt"
 
Last edited:
I don't know if this is possible, but you could try this approach.
Add a runat="server" attribute to the PARAM tag, like so:
Code:
<PARAM NAME="image_pan_tilt" VALUE="" runat="server" id="imagePanTiltParam">

Then, in your code-behind page, declare an HtmlGenericControl in
the General Declarations section of the code:
Visual Basic:
Private imagePanTiltParam As HtmlGenericControl

Then just change its attributes from your code:
Visual Basic:
imagePanTiltParam.Attributes("value") = "the new value goes here"

It's a long shot, but it's worth trying.
 
Back
Top