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

  • Thread starter Thread starter Softwaremaker
  • Start date Start date
S

Softwaremaker

Hi all,

I have created a control that runs on a web form. This control is a
composite control comprising of other textboxes (public scope).

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
 
* "Softwaremaker said:
I have created a control that runs on a web form. This control is a
composite control comprising of other textboxes (public scope).

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
?

You may want to turn to the ng for ASP.NET Web Controls questions for future
ASP.NET Web Control related questions:

<
Web interface:

<http://msdn.microsoft.com/newsgroup...ft.public.dotnet.framework.aspnet.webcontrols>
 
Hi,

This question may fit here as the control I had created actually inherits
the Windows.Forms.Control class, so its actually running a Windows Form on a
browser.

but I will post the same in that ng anyways...

Thanks.

++++++++++++++++++++
 
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.)
 
Back
Top