//用意是想在页面提交后,zt的值依然能保持住,
//公司现已经成形的软件,新手刚进来要分解
<%@ Page Language="vb" %><!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" >
<script type="text/javascript" language="javascript">
function cl(){
alert(2);
form1.zt.value="a";
form1.submit();
}
</script>
<head id="Head1" runat="server">
<title>无标题页</title>
</head>
<body><%
Dim zt As String
zt = "e"
If Len(Trim(Request.Form("zt"))) > 0 Then
zt = Trim(Request.Form("zt"))
End If
Select Case zt
Case "e"
Response.Write("<script>window.alert('0');<")
Response.Write("/script>")
Case "a"
Response.Write("<script>window.alert('1');<")
Response.Write("/script>") End Select
%> <form id="form1" runat="server" method="post">
<input type=hidden name="zt" value="<%=zt%>">
<div>
<table id='t' style="width: 328px; height: 58px" >
<tr>
<td style="width: 202px"><input type="Button" ID='bt' OnClick="cl()" name="goto" value="goto" style="width: 161px; height: 29px" /></td><td>cc</td>
</tr>
</table>
</div>
</form>
</body>
</html>
//公司现已经成形的软件,新手刚进来要分解
<%@ Page Language="vb" %><!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" >
<script type="text/javascript" language="javascript">
function cl(){
alert(2);
form1.zt.value="a";
form1.submit();
}
</script>
<head id="Head1" runat="server">
<title>无标题页</title>
</head>
<body><%
Dim zt As String
zt = "e"
If Len(Trim(Request.Form("zt"))) > 0 Then
zt = Trim(Request.Form("zt"))
End If
Select Case zt
Case "e"
Response.Write("<script>window.alert('0');<")
Response.Write("/script>")
Case "a"
Response.Write("<script>window.alert('1');<")
Response.Write("/script>") End Select
%> <form id="form1" runat="server" method="post">
<input type=hidden name="zt" value="<%=zt%>">
<div>
<table id='t' style="width: 328px; height: 58px" >
<tr>
<td style="width: 202px"><input type="Button" ID='bt' OnClick="cl()" name="goto" value="goto" style="width: 161px; height: 29px" /></td><td>cc</td>
</tr>
</table>
</div>
</form>
</body>
</html>
那你需要在提交之后,再将tz的值 返回html页面,进行赋值
这样就可以保持值不动了
<input type=hidden name="zt" value="<%=zt%>">
提示zt无定义
ID="ZT"也加上看看否则form1.zt.value="a";
这边可能认不出
第一处
<%
Dim zt As String
zt = "e"
If Len(Trim(Request.Form("zt"))) > 0 Then
zt = Trim(Request.Form("zt"))
End If
Select Case zt
Case "e"
Response.Write("<script>window.alert('0');<")
Response.Write("/script>")
Case "a"
Response.Write("<script>window.alert('1');<")
Response.Write("/script>") End Select
%>
第二处 <input type=hidden id ="zt" name="zt" value="<%=zt%>">
都是要你加个DIM
但是你已经有了