469,891 Members | 2,251 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,891 developers. It's quick & easy.

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

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
Nov 17 '05 #1
2 1440
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.

"Softwaremaker" <ms**@removethis.softwaremaker.net> wrote in message
news:Oa**************@TK2MSFTNGP12.phx.gbl...
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

Nov 17 '05 #2
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.)

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by turnit \(removethis\) | last post: by
1 post views Thread by Eugfene | last post: by
2 posts views Thread by Matt Theule | last post: by
4 posts views Thread by Andrea Williams | last post: by
2 posts views Thread by Hugh | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.