J
Jim Hammond
I can get data from a client-side assembly to the server in two manual
steps, but I need to be able to do it in one step.
Step 1:
The user presses the manually coded "Step 1" button, which calls the
JavaScript function.
The function copies the data into a server textbox control.
Step 2:
The user presses the VS generated "Step 2" button, which calls the
server-side event handler "Button1_Click".
Button1_Click can read and thus process the contents of the server control.
<body MS_POSITIONING="GridLayout">
<OBJECT id="myControl1" height="288" width="312"
classid="ClientSideAssembly.dll#ClientSideAssembly.myControl"
name="myControl1" VIEWASTEXT>
</OBJECT>
<form id="Form1" name="Form1" method="post" runat="server" VIEWASTEXT>
<input onclick="doScript();" type="button" value="step 1" style="WIDTH:
100px; HEIGHT: 24px">
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 11px; POSITION:
absolute; TOP: 400px"
runat="server" Width="359px"></asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 375px; POSITION:
absolute; TOP: 400px"
runat="server" Text="Step 2" Width="82px"></asp:Button>
</form>
<script language="javascript">
function doScript()
{
// This line successfully uses the client-side assembly
// to read text from a client file and assign it to a server control,
// but this doesn't trigger the TextBox1_TextChanged event for that
server control.
Form1.TextBox1.value = myControl1.FileText;
}
</script>
</body>
steps, but I need to be able to do it in one step.
Step 1:
The user presses the manually coded "Step 1" button, which calls the
JavaScript function.
The function copies the data into a server textbox control.
Step 2:
The user presses the VS generated "Step 2" button, which calls the
server-side event handler "Button1_Click".
Button1_Click can read and thus process the contents of the server control.
<body MS_POSITIONING="GridLayout">
<OBJECT id="myControl1" height="288" width="312"
classid="ClientSideAssembly.dll#ClientSideAssembly.myControl"
name="myControl1" VIEWASTEXT>
</OBJECT>
<form id="Form1" name="Form1" method="post" runat="server" VIEWASTEXT>
<input onclick="doScript();" type="button" value="step 1" style="WIDTH:
100px; HEIGHT: 24px">
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 11px; POSITION:
absolute; TOP: 400px"
runat="server" Width="359px"></asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 375px; POSITION:
absolute; TOP: 400px"
runat="server" Text="Step 2" Width="82px"></asp:Button>
</form>
<script language="javascript">
function doScript()
{
// This line successfully uses the client-side assembly
// to read text from a client file and assign it to a server control,
// but this doesn't trigger the TextBox1_TextChanged event for that
server control.
Form1.TextBox1.value = myControl1.FileText;
}
</script>
</body>