Question: "PARAM" value issue

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

I created a VB6 user control with a ActiveX Knob on it. Here's the simple
code:
Public Property Get Value() As Integer
Value = CWKnob.Value
End Property
Public Property Let Value(Value As Integer)
CWKnob.Value = Value
lblValue.Caption = CWKnob.Value
End Property

When I put the user control on a webform and look the HTML I don't see
PARAMs for the "Value" value. All I see is "_ExtentX" and "_ExtentY". I
need to set this value dynamically through my webform. Here's the HTML
portion...
<OBJECT id="ucMyKnob" classid="clsid:7..." name="ucMyKnob" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="3228">
<PARAM NAME="_ExtentY" VALUE="2937">
</OBJECT>

1. What do I have to do in the user control so that it will show up as a
"PARAM"?
2. In my webform how can I change the value of the user control dynamically
(by manipulated the PARAM value)?

Thanks,
Robert
 
1) just edit html and add your parameter

<OBJECT id="ucMyKnob" classid="clsid:7..." name="ucMyKnob" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="3228">
<PARAM NAME="_ExtentY" VALUE="2937">
<PARAM NAME="Value" VALUE="49">
</OBJECT>

2) there is no direct support in asp.net. you can use a literal html control
and set the inner html or use <%= %>

<OBJECT id="ucMyKnob" classid="clsid:7..." name="ucMyKnob" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="3228">
<PARAM NAME="_ExtentY" VALUE="2937">
<PARAM NAME="Value" VALUE="<%=myValue%>">
</OBJECT>
 
BTW I'd like to avoid scripting if possible. Can I set the value of a PARAM
through VB.NET code on a webform?
 
Back
Top