客户端是这样写的: <script language="javascript"> function test() { document.all["hid_test"].value = document.all["t1"].innerText; alert(document.all["hid_test"].value); send("http://202.120.223.34/AutoPodcasting/webfrmConvertion.aspx?ID=hid_test"); } </script>服务器端webfrmConvertion.aspx页面的load是这样写的: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim strDescription As String strDescription = Request("hid_test").ToString() Response.Write("if you can see these words: " + strDescription + " then,it is OK !") Response.End() End Sub可是一直报错,请问错在哪里了?
2.可以加个隐藏控件<input type="hidden" runat="server" id="test">
-------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Jzero</TITLE>
<script language="javascript">
function test()
{
document.all["hid_test"].value = document.all["t1"].innerText;
alert(document.all["hid_test"].value);
}
</script>
</HEAD><BODY>
<table id="t1">
<tr>
<td>
a;lkfdjalk;dfjldahr;343h4h34;3l4;lkjfadklfj;daf
</td>
<tr>
</table>
<input type="hidden" id="hid_test" runat="Server">
<input type="button" onclick="test()">
</BODY>
</HTML>
<script language="javascript">
function test()
{
document.all["hid_test"].value = document.all["t1"].innerText;
alert(document.all["hid_test"].value);
send("http://202.120.223.34/AutoPodcasting/webfrmConvertion.aspx?ID=hid_test");
}
</script>服务器端webfrmConvertion.aspx页面的load是这样写的:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim strDescription As String
strDescription = Request("hid_test").ToString()
Response.Write("if you can see these words: " + strDescription + " then,it is OK !")
Response.End()
End Sub可是一直报错,请问错在哪里了?
1.要么用Session(这种可以不用就不要用~)
2.要么用页面Request(这个用得好多的...)
------------------------------------------------------
好像没有这样写法的~~!
send("http://202.120.223.34/AutoPodcasting/webfrmConvertion.aspx?ID=hid_test");
改为:
location.href = "webfrmConvertion.aspx?ID=" + document.all["hid_test"].value;