Pass value to and from win form control

R

rperreta

Ok, I have this really cool looking windows form control that runs in the
browser and when the user clicks on the filename it sets the value to a
parameter in the web page. How can I retreive that value to use within the
web page. In short if a user does something on the form how can get the
values of what was selected or entered?

-rjp
 
S

Steve C. Orr [MVP, MCSD]

Client side script can call methods and properties of the embedded windows
control, but the reverse is not true.
There is no way (considering security restrictions) that the control can
raise events to the page or call any properties or methods of the page or
its DOM.
Therefore if the page wants to know anything from the embedded control it
must ask the control for it as often as necessary. Sometimes this means
using a JavaScript timer to have the page regularly poll the embedded
windows control by calling one of its public properties or methods.

Here's more info:
http://SteveOrr.net/articles/WinFormControls.aspx
 
R

rperreta

I'm stuck... here's what I have

on my control the users selects a file from the file list:

Public

SelectedFile As New System.Web.UI.HtmlControls.HtmlInputHidden
Private Sub FileList_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles FileList.SelectedIndexChanged

SelectedFile.Value = FileList.SelectedItem.ToString
End Sub

Should I be declaring SelectedFile as something else?

Here is my aspx page and code behind it:

<%

@ Page Language="VB" AutoEventWireup="false"
CodeFile="upload_manager.aspx.vb" Inherits="upload_manager" %>
<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<

html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Upload Manager</title>
</head>
<body>
<form id="form1" runat="server">
<input type=hidden id=SelectedFile name=selectedfile runat=server
style="z-index: 100; left: 0px; position: absolute; top: 0px" />

<asp:Button ID="btnUpload" runat="server" Font-Names="Verdana"
Font-Size="8pt" Height="24px" Style="z-index: 101; left: 471px; position:
absolute; top: 220px" Text="Upload File" Width="89px" />

<object id=FileControl1 height=195 width=547
classid=http:FileControl.dll#FileControl.FileControlUpload>
Control Failed to Load: <br /><br />
</object>
</form>
</body>
</html>
aspx page code behind:


Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnUpload.Click
Response.Write(SelectedFile.Value)
Response.End()
End Sub
I don't think its setting the value to the hidden text box.

thanks

rich
 

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

Members online

No members online now.

Forum statistics

Threads
474,125
Messages
2,570,748
Members
47,301
Latest member
SusannaCgx

Latest Threads

Top