activex直接对ASP页面的text字段赋值,如何实现(100分)

L

lsys

Unregistered / Unconfirmed
GUEST, unregistred user!
activex直接对ASP页面的text控件赋值,如何实现?
 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html
charset=gb2312">
<title>ActiveForm Property and Method Test</title>
<script language="JavaScript">
<!--
function Showmsg() {
document.all["txtNow"].value = Ax1.FNow;
document.all["txtDate"].value = Ax1.FDate;
document.all["txtTime"].value = Ax1.FTime;

var now = new Date();
var year = now.getYear();
var month = now.getMonth()+1;
var date = now.getDate();
var datestr = year+"-"+month+"-"+date;
document.all["txtDateTime"].value = datestr;
}

function SetlblCaption(){
var str;
str = document.all["txtlblCaption"].value;
Ax1.lblCaption = str;
}

function SetbtnCaption(){
var str;
str = document.all["txtbtnCaption"].value;
Ax1.btnCaption = str;
}

function SetButtonCaption(){
var str;
str = document.all["txtButtonCaption"].value;
Ax1.ButtonCaption = str;
}

function ShowCaption(){
Ax1.ShowCaption();
}

function SetParam(){
var pa1, pa2, pa3, pa4;
pa1 = document.all["txtpa1"].value;
pa2 = document.all["txtpa2"].value;
pa3 = document.all["txtpa3"].value;
pa4 = document.all["txtpa4"].value;
Ax1.PassParam(pa1, pa2, pa3, pa4);
}

function Clear(){
Ax1.Clear();
}

function GetParam(){
var pa1, pa2;
var pb1, pb2;
// pa1 = "1234";
// pa2 = "aaaa";
Ax1.OutParam(pa1, pa2);
pb1 = pa1;
pb2 = pa2;
document.all["txtParam1"].value = pb1;
document.all["txtParam2"].value = pb2;
}

function ShowAbout(){
Ax1.AboutBox();
}

//-->
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#CCCCCC" scroll="auto">
<table border="1" cellspacing="0" cellpadding="4" bordercolorlight="#000000" bordercolor="#FFFFFF" name="table1" width="100%">
<tr bgcolor="#000000" align="center" valign="middle">
<td colspan="2"> <font color="#FF0000"><b><font size="5">ActiveForm Property
and Method Test</font></b></font></td>
</tr>
<tr>
<td bgcolor="#CCCCCC" rowspan="2" width="50%" align="center" valign="middle">
<object
classid="clsid:97BA702A-E192-4ADE-804C-F3B05B833ADA"
codebase="http://192.168.0.20/Active-JCY/ActFormTest.ocx#version=1,0,11,0"
width=388
height=230
align=center
hspace=0
vspace=0
name="Ax1">
<param name="ButtonCaption" value="ButtonCaption">
<param name="btnCaption" value="btnCaption">
<param name="lblCaption" value="lblCaption">
<param name="FCaption" value="FCaption">
<param name="AxBorderStyle" value="1">
<param name="font" value="20">
</object> </td>
<td valign="middle" align="center" bgcolor="#CCCC00" width="50%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>FNow:</td>
<td align="center">
<input type="text" name="txtNow" size="40">
</td>
</tr>
<tr>
<td>FDate:</td>
<td align="center">
<input type="text" name="txtDate" size="40">
</td>
</tr>
<tr>
<td>FTime:</td>
<td align="center">
<input type="text" name="txtTime" size="40">
</td>
</tr>
<tr>
<td>Now:</td>
<td align="center">
<input type="text" name="txtDateTime" size="40">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="button" name="B1" value="GetProperty" onClick="Showmsg()">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="middle" align="center" bgcolor="#669900" width="50%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>OutputParam1:</td>
<td align="center">
<input type="text" name="txtParam1" size="35">
</td>
</tr>
<tr>
<td>OutputParam2:</td>
<td align="center">
<input type="text" name="txtParam2" size="35">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" name="B2" value="GetParam" onClick="GetParam()">
</td>
</tr>
</table>
</td>
</tr>
<tr align="center" valign="middle">
<td bgcolor="#009999">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>lblCaption:</td>
<td align="left">
<input type="text" name="txtlblCaption" value="lblCaption" size="30">
</td>
<td align="left">
<input type="button" value="SetlblCaption" name="B3" onClick="SetlblCaption()">
</td>
</tr>
<tr>
<td>btnCaption:</td>
<td align="left">
<input type="text" name="txtbtnCaption" size="30" value="btnCaption">
</td>
<td align="left">
<input type="button" name="B8" value="SetbtnCaption" onClick="SetbtnCaption()">
</td>
</tr>
<tr>
<td>ButtonCaption:</td>
<td align="left">
<input type="text" name="txtButtonCaption" size="30" value="ButtonCaption">
</td>
<td align="left">
<input type="button" name="B9" value="SetButtonCaption" onClick="SetButtonCaption()">
</td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#009999"><font color="#FF0000">Method:</font></td>
<td align="left">
<input type="button" value="ShowCaption" name="B5" onClick="ShowCaption()">
</td>
</tr>
</table>

</td>
<td bgcolor="#999900" rowspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>IntputParam1:</td>
<td align="center">
<input type="text" name="txtpa1" size="35" value="12345">
</td>
</tr>
<tr>
<td>IntputParam2:</td>
<td align="center">
<input type="text" name="txtpa2" size="35" value="7654321">
</td>
</tr>
<tr>
<td>IntputParam3:</td>
<td align="center">
<input type="text" name="txtpa3" size="35" value="This is a string">
</td>
</tr>
<tr>
<td>IntputParam4:</td>
<td align="center">
<input type="text" name="txtpa4" size="35" value="127">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="SetParam" name="B4" onClick="SetParam()">
<input type="button" value="Clear" name="B6" onClick="Clear()">
</td>
</tr>
</table>
</td>
</tr>
<tr align="center" valign="middle">
<td bgcolor="#009999">
<input type="button" value="ActiveFormAbout" name="B7" onClick="ShowAbout()">
</td>
</tr>
</table>
</body>
</html>
 

Similar threads

S
回复
0
查看
955
SUNSTONE的Delphi笔记
S
S
回复
0
查看
777
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部