asp问题,抓狂中

coolaxb 2002-04-19 10:23:08
如何让一个框架中的若干ASP文件能传递参数

比如一个表单在框架的一个ASP文件中,提交按钮在框架的另一个ASP文件中

如何能在按下按钮后,表单的信息能传递到第三个ASP文件中?
...全文
26 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
so_good 2002-04-19
  • 打赏
  • 举报
回复
My God!在login_main.asp中你漏了最关键的东西!
<form name="login_main_form" action="result_main.asp" method="post">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
绝对正确,我试过了!
coolaxb 2002-04-19
  • 打赏
  • 举报
回复
我知道了

在login_main.asp里加上一句

<form name="login_main_form" action="result_main.asp" method="post" target="mainFrame">


谢谢大家
呵呵,搞定了
加分啊
coolaxb 2002-04-19
  • 打赏
  • 举报
回复
更改如下:

login.asp
___________________________________________
<html>
<head>
<title>login</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<frameset rows="103,*" frameborder="YES" border="0" framespacing="0" cols="*">
<frame name="topFrame" scrolling="YES" noresize src="login_top.asp" >
<frame name="mainFrame" src="login_main.asp">
</frameset>

<noframes><body bgcolor="#FFFFFF" text="#000000">

</body></noframes>
</html>
----------------------------------------------------

login_main.asp
---------------------------------------------------
<HTML>
<head>
<title>login_main</title>
</head>
<body>
<form name="login_main_form">
<P><FONT face="宋体">please provide your name:</FONT></P>
<P><FONT face="宋体">First name : <INPUT id="Text1" type="text" name="firstname"></FONT></P>
<P><FONT face="宋体">Last name: <INPUT id="Text2" type="text" name="lastname"></FONT></P>
<P><FONT face="宋体">your message: <TEXTAREA id="Textarea1" name="message" rows="6" cols="27"></TEXTAREA></FONT></P>
</form>
</body>
</HTML>
--------------------------------------------------------------

login_top.asp
------------------------------------------------------------
<html>
<head>
<title>login_top</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form action="result_main.asp" method="post" target="mainFrame">
<P>
<input id="Button1" type=button value="submit form" name="submit" onclick="parent.mainFrame.login_main_form.submit()">
</P>
</form>
</body>
</html>
-------------------------------------------------------

result_main.asp
---------------------------------------------------------
<%@ Language=VBScript %>
<%
Option Explicit
Response.Expires=0
Dim strfirstname,strlastname
Dim strUnformattedMessage,strMessage
if Request.ServerVariables("CONTENT_LENGTH")<>"" then
strfirstname= Trim(Request.Form("firstname"))
strlastname= Trim(Request.Form("lastname"))
strMessage= Trim(Request.Form("message"))
strMessage= Replace(strMessage,vbcrlf,"<br>"&vbcrlf)
%>
<HTML>
<head>
<title>result_main</title>
</head>
<body>
the script has received the form data.<br><br>
first name:<%=strfirstname%><br><br>
last name:<%=strlastname%><br><br>
message:<%=strMessage%><br><br>
</body>
</HTML>
<%end if%>
--------------------------------------------------------------

能给看看吗
coolaxb 2002-04-19
  • 打赏
  • 举报
回复
但结果是根本提交不了,你可以试试啊

so_good 2002-04-19
  • 打赏
  • 举报
回复
你没看见我用了parent.frame1Name来指向第一个asp文件所在的帧吗?
so_good 2002-04-19
  • 打赏
  • 举报
回复
你没看到我用了parent.frame1Name来指向第一个asp页面所在的帧吗?
coolaxb 2002-04-19
  • 打赏
  • 举报
回复
9742wsx(aa)

你的回复有点看不懂,能给解释一下吗

so_good(blues)

你理解错了,按钮和表单是分开的,不能在同一文件中

genuis(不死鸟)

如果表单很大呢?那你的函数是不是太大了啊:)

希望能有更好的办法:)
genuis 2002-04-19
  • 打赏
  • 举报
回复
<form action ="result_main.asp" method="post" name=form2>


<script language=javascript>
function submit(theForm)
{
theForm.firstname.value=mainFrame.form2.firstname.value;
.....................
return true;
}
</script>
<form name=form1 action="refer.asp" onsubmint=submit(this)>
<input type=hidden value="" name="firstname">
</form>
9742wsx 2002-04-19
  • 打赏
  • 举报
回复
asp1页面 :
<form action="asp3.asp" method=post name=frm1>
<input type=text name=text1>
</form>

asp2 页面:
<input type=button name=button1>

<script language="vbs">
sub button1_onclick()
document.frm1.submit
end sub
</script>
so_good 2002-04-19
  • 打赏
  • 举报
回复
补充:
第二个asp中
提交按钮type=button,onclick="parent.frame1Name.formName.submit()"
coolaxb 2002-04-19
  • 打赏
  • 举报
回复
你的方法试过了

数据还是不能传啊

我的文件如下

login.asp******************************

<html>
<head>
<title>login</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<frameset rows="103,*" frameborder="YES" border="0" framespacing="0" cols="*">
<frame name="topFrame" scrolling="YES" noresize src="login_top.asp" >
<frame name="mainFrame" src="login_main.asp">
</frameset>

<noframes><body bgcolor="#FFFFFF" text="#000000">

</body></noframes>
</html>

login_main.asp**************************
<HTML>
<head>
<title>login_main</title>
</head>
<body>
<form action ="result_main.asp" method="post">
<P><FONT face="宋体">please provide your name:</FONT></P>
<P><FONT face="宋体">First name : <INPUT id="Text1" type="text" name="firstname"></FONT></P>
<P><FONT face="宋体">Last name: <INPUT id="Text2" type="text" name="lastname"></FONT></P>
<P><FONT face="宋体">your message: <TEXTAREA id="Textarea1" name="message" rows="6" cols="27">
</TEXTAREA></FONT></P>
</form>
</body>
</HTML>

login_top.asp*******************************************

<html>
<head>
<title>login_top</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form action="result_main.asp" method="post" target="mainFrame">
<P>
<input id="Button1" type="Submit" value="submit form" name="submit">
</P>
</form>
</body>
</html>

result_main.asp********************************
<%@ Language=VBScript %>
<%
Option Explicit
Response.Expires=0
Dim strfirstname,strlastname
Dim strUnformattedMessage,strMessage
if Request.ServerVariables("CONTENT_LENGTH")<>"" then
strfirstname= Trim(Request.Form("firstname"))
strlastname= Trim(Request.Form("lastname"))
strMessage= Trim(Request.Form("message"))
strMessage= Replace(strMessage,vbcrlf,"<br>"&vbcrlf)
%>
<HTML>
<head>
<title>result_main</title>
</head>
<body>
the script has received the form data.<br><br>
first name:<%=strfirstname%><br><br>
last name:<%=strlastname%><br><br>
message:<%=strMessage%><br><br>
</body>
</HTML>
<%end if%>


能帮我看看吗
孟子E章 2002-04-19
  • 打赏
  • 举报
回复
action="asp3.asp" target="frameName3"
coolaxb 2002-04-19
  • 打赏
  • 举报
回复
浏览器禁用COOKIE

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧