【发布时间】:2011-01-01 13:14:44
【问题描述】:
我在我的页面上使用了一个文字,其中包含一个 html 表单。单击特定链接时会显示此文字,页面上会显示覆盖 div,并在覆盖 div 上显示表单。所有浏览器都可以正常工作并且完全符合预期,但 IE 不会在覆盖 div 上显示任何内容,即覆盖 div 出现但为空。我已经尝试将标签一一添加到文字控件中,以查看究竟是哪个标签导致了问题,结果发现所有内容(HTML 输入控件等)都显示在覆盖 div 上,直到添加了 <form> 标签文字。
如果literal.Text 属性没有<form> 标记,则内容在IE 中也可以正常显示。但问题是我需要在文字中包含这个<form>,因为我必须将数据发布回外部链接。当所有其他浏览器都工作正常时,IE 中可能出现什么问题?
以下是设置时的文字内容:
formSalesForce.Text = "<div style='clear:both'></div><h2 class='sIFR-replaced1' style='text-align:left'><embed height='20' id='h2heading' width='282' src='frutiger_light.swf' quality='best' flashvars='txt=Document Description&textalign=left&offsetTop=0&textcolor=#878787&hovercolor=#76b404&linkcolor=#87be22&w=282&h=20' wmode='transparent' bgcolor='transparent' sifr='true' type='application/x-shockwave-flash' class='sIFR-flash1' style='width: 282px; height: 20px;'/><span class='sIFR-alternate'>Document Description</span></h2>" + d.DocDescription + "<BR><p>Please fill out the following information so that we can proceed with providing you the link to the document</p><form id='myDocForm' name='myDocForm' action='" + d.DataSubmissionPath + "' method='POST' ><table class='clearBoth' width='45%'><tr><td><input type=hidden name='oid' value='" + d.OID + "'></td><td><input type=hidden name='retURL' value='" + "" + "'></td></tr><tr><td class='formlabel' >First Name*</td><td class='formfield'><input type='text' id='first_name' size='20' maxlength='40' name='first_name'></td></tr><tr><td class='formlabel'>Last Name*</td><td class='formfield'><input type='text' id='last_name' size='20' maxlength='40' name='last_name'></td></tr><tr><td class='formlabel'>Email*</td><td class='formfield'><input type='text' id='email' size='20' maxlength='40' name='email'></td></tr><tr><td class='formlabel'>Work Title</td><td class='formfield'><input type='text' id='work_title' size='20' maxlength='40' name='work_title'></td></tr><tr><td class='formlabel'>Company</td><td class='formfield'><input type='text' id='company' size='20' maxlength='40' name='company'></td></tr><tr><td class='formbuttons'><input type='Button' name='btnsubmit' value='Submit' onclick='showDocPanel();'></td></tr></table></form>"
【问题讨论】:
-
能否提供文字控件的内容?
-
查看源码时,看到
<form>元素了吗?并不是说您有两种形式(一种来自 asp.net),因此它们的行为不会像您期望的那样。你试过老式的 iframe 吗? -
抱歉 stackoverflow.com 没有在我结束时打开,所以我无法早点回复您的帖子。 @Kobi:当我查看页面的源代码时,我看不到表单,我知道我有两种表单,一种是 aspnet,一种是基于普通 html 的......但问题是我已经让它在其他方面工作了浏览器,但不是 IE
-
@Himadri:我已经添加了文字控制内容
-
Kobi 能否也请您向我解释一下 iframe 方法...因为我不确定我在互联网上找到的 iframe 方法是否适用于我的情况.. thnx
标签: asp.net html internet-explorer