asp.net 从其中一个框架中提交表单数据到另一框架中

我建了一个Default的框架页,里面的frameset包含多个frame其中有一个叫search.aspx,另一个叫main.aspx。两个页面在Default.aspx中的框架名称为searchFrame和mainFrame现在我在search.aspx中有一个表单的数据需要提交到main.aspx中处理代码如下<form id="seachinfo" runat="server" method = "post" >...<input id="submitButton" type="button" value="查询" /></form>问:如何将search.aspx表单提交到框架中的main.aspx,并且刷新main.aspx?(不是在新弹出窗口中显示,就在当前窗口的frame中显示。打开网站时,默认页是Default.aspx)我上网搜过了,很多人说<from ... action = "main.aspx" target = "mainFrame">或者是<from ... action = "main.aspx">或者是<from ... target = "mainFrame">。貌似都没有用。javascript我没学,如果能解决问题,最好帮忙把代码写完整。谢谢。问题解决后再追分。
2026-12-04 15:15:12
推荐回答(1个)
回答1:

index.aspx

HTML code




无标题文档






<body><br></body><br>< frames>< ml><br><br>main.aspx <br><br>HTML code<br><%@ Page Language="VB" ContentType="text ml" ResponseEncoding="utf-8" %><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br><html xmlns=" http://www.w3.org/1999/xhtml"><br><head><br><meta http-equiv="Content-Type" content="text ml; charset=utf-8" /><br><title>无标题文档</title><br></head><br><body><br><%<br> dim keyword as string=""<br> if not isnothing(request("keyword")) then<br> keyword=request("keyword")<br> end if<br> <br> response.write(keyword)<br>%><br></body><br>< ml><br><br>S-Cofield 19:35:59<br>search.aspx <br><br>HTML code<br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br><html xmlns=" http://www.w3.org/1999/xhtml"><br><head><br><meta http-equiv="Content-Type" content="text ml; charset=utf-8" /><br><title>无标题文档</title><br></head><br><br><body><br><input id="keyword" name="keyword" type="text" /><br><input id="Button" type="button" value="查询" onClick="javascript:gosearch()" /><br><script language="javascript"><br>function gosearch()<br>{<br>var aa = document.getElementById("keyword").value;<br>window.parent.mainFrame.location.href=&#39;main.aspx?keyword=&#39;+escape(aa);<br>}<br></script><br></body><br>< ml></p> </div> </div> <div class="clear"></div> </div> </div> </div> <div class="wendaright"> <div class="wdluluerwema"> <div class="wdxgwttop">相关问答</div> <div class="wdxgwtnr"> </div> <div class="clear"></div> </div> <!-- 其他随机问答['id'=>alphaID($like['zid'])] --> <div class="wdluluerwema"> <div class="wdxgwttop">最新问答</div> <div class="wdxgwtnr"> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/1870646049129258867.html">什么叫桥为什么要叫桥</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/1431300775261829299.html">2014年山东第四季度会计从业资格考试报名入口现在可以报名了么?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/332329707.html">求推荐一款价格大概1800左右的触屏手机!!!采纳有加分</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/506301587206784844.html">恕道的意思恕道的意思是什么</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/1549886668498587307.html">哪首歌最能代表你的青春?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/443425694670956724.html">二战最强步枪</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/367852681.html">修MP4要多少钱</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/1391954830050006620.html">平均值怎么求</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/563291849.html">关于龙OL灵宠</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://g230.com/68946258.html">LG126手机能否往电脑里导出通讯录</a></div> </div> </div> </div> </div> <div class="clear"></div> <div class="footer"> <!-- 移动底部导航 --> <div class="fanhuitop"><a href="#top" ref="nofollow"><img src="https://g230.com/static/old/img/fhtop.png" alt="返回顶部" title="返回顶部"></a></div> <div class="dibu"> <div class="dibu"> </div> </div> <div class="banquan"> </div> </div> </div> </div> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?7eddc45edb08663cdc348b57eeb77b88"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </body> </html>