How do I retrieve / request a Windows.Form.Control's Value running on a WebForm ?

S

Softwaremaker

Hi all,

I have created a Windows Form control that runs on a web form. This control
is a
composite control comprising of other textboxes (public scope). This control
inherits from the Windows.Form.Control class.

I have put it on a web form with the following code :

<OBJECT id="MyWebControl" height="300" width="300"
classid="http:MyWebControl.DLL#My.MyWebControl1"
VIEWASTEXT>
</OBJECT>

Everything is OK but when I submit the page to the Web Server, how do I
retrieve the public textboxes values so I can process them on the web server
?

Any help is appreciated.

Thank you.

Softwaremaker
 
M

MSFT

Hello,

In this way, your Windows control is a client side control, and you cannot
access it from server side code. To get its values, you can add some
"Hidden input" field to the web form, for example, if your windows control
has a public property "CustomerName", you may add a hidden input field to
the web form:

<INPUT id="CustomerName" type="hidden" name="CustomerName">

Before you submit the web form to server, you can add following script:

CustomerName.value=MyWebControl.CustomerName

And on server side, you can get the value from

request.form("CustomerName")

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
R

Rajesh.V

When u submit, you will have to copy the things u need from inside the
control onto hidden fields. This can be done by js attached to the submit
button and by exposing the data reqd to be taken out of the control as
properties.
 

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

Top