惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - Tiu

2010走了,又是一年,留个脚印 Commerce Server 2007 随笔一 2009眨眼间过去了,留个纪念 asp.net ajax随笔二 asp.net中慎用static全局变量 asp.net ajax随笔一 收集的关于依赖注入及Unity application block入门的一些资料 2008最后一篇:总结与展望 文件操作类简介 防止页面在提交的过程中多次点击按钮 第一次使用SQLCLR C#网络编程随笔一 装AJAX.NET 1.0的环境,我遇到个问题,进来解答下 关于邮件群发 XML学习一 URL重写入门 动态从数据库中选择Top 个数 关于在数据层返回SqlDataReader 编写类和子程序的几个原则
asp.net窗中的两个Form问题
Tiu · 2006-12-27 · via 博客园 - Tiu

      今天在做网站程序的时候,需要在网站首页嵌入登入另外一个网站邮箱的入口,入口写起来简单,去他那网站入口把html代码考过来就能用,下面便是登录宽带中国的邮箱的入口,把它存成html页面输入用户名密码便可登录。

<form name="mail" method="post" action="http://mail.bdchina.com/icp/login.jsp" method="POST" name="login_form" id="login_form" onSubmit="return doLogin(this);" target="_blank">
            
<td align="right" width="50">用户名:</td>
            
<td width="100" align="left"> 
              
<input type="hidden" name="username"  value=""><input  name="emailname"  type="text" id=text1 class="top-input">
            
<input type="hidden" name="domainname" value="sdxxh.gov.cn" ></td>
            
<td width="50" align="right">密 码: </td>
            
<td width="100" align="left"> 
            
<input  name="password"  type="password" class="top-input"></td>
            
<td width="50" align="center"> 
            
<input onclick="login_form.action='http://mail.bdchina.com/icp/login.jsp'" name="Submit"  type="submit" value="登 录" class="button"></td>
            
<td width="50" align="center"> 
            
<input onClick="javascript:window.open('#');" name="Submit2" type="button"  value="注 册" class="button"></td
            
>
            
</form>

接下来问题就来,我的首页当然也有自己的form: <form id="Form1" method="post" runat="server"></form>
只不过我的窗体的asp.net的窗体runat=server,而邮箱的窗体是普通窗体,开始的时候我就用
<!-- #include file="email.htm" -->嵌入进去,页面显示正常,但一点击登录按钮我的页面就刷新了,不会转到bdchina的网站上,(这里出现一个问题困扰我很久:我把整个页面的EnableViewState设置为false,我一点击登录按钮首页的从数据库取的数据的内容全部消失,原因应该是我一点按钮触发一个postback事件,而我又禁用了EnableViewState状态,所以内容就消失了。问题是:我的按钮是html控件submit,我不知怎么让它不去回发,应该是post事件造成的,具体细节还没弄清,html的button类型就没有事。);后来上网搜一下,发现两个窗体同时存在行,但是不能嵌套,但是我那个嵌套并没有出错,显示效果也跟预想的一样,只是功能,不知有没有朋友这么用过?
         最后我只有把<!-- #include file="email.htm" -->加到<form id="Form1" method="post" runat="server"></form>之外,这样就OK了,声明一下我的email.htm里面不是完成的页面也即没有html,body等元素,而且我为了显示效果,两个form的内容是在一个table里,大家可以看看效果:

其中网站搜索左边的地方即email.htm里的内容,是html窗体,网站搜索后面的是asp.net窗体里的内容,这样就无缝的合在一块了。