将第二个表单添加到 VB .NET 页面后出现黑线?
我有一个从母版页创建的页面。母版页有一个表单标记,其中包含正文标记上的内容,然后我在从母版创建的页面上有一个表单来处理上传文件:
Master:
<form id="form1" runat="server">
page content here
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</form>
Page:
<form id="form1" method="post" enctype="multipart/form-data">
<input type="file" id="File1" name="File1" runat="server" />
<input type="submit" id="Submit1" value="Upload" runat="server" />
<br />
<asp:Label ID="UploadErrorMessage" runat="server"></asp:Label>
<br />
<asp:Label ID="fileOne" runat="server"></asp:Label>
</form>
在我的 css 文件中,我添加了规则来消除任何边框:
form {
margin: 0;
margin-bottom: 0;
margin-top: 0;
padding: 0;
}
这是一张图片(请注意,如果我注释掉上传表单,这条黑线就会消失): http://img191.imageshack.us/img191/7503/blackline.jpg
I have a page created from a master page. the master page has a form tag which contains the contents on the body tag and then i have a form on the page created from the master to handle uploading a file:
Master:
<form id="form1" runat="server">
page content here
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</form>
Page:
<form id="form1" method="post" enctype="multipart/form-data">
<input type="file" id="File1" name="File1" runat="server" />
<input type="submit" id="Submit1" value="Upload" runat="server" />
<br />
<asp:Label ID="UploadErrorMessage" runat="server"></asp:Label>
<br />
<asp:Label ID="fileOne" runat="server"></asp:Label>
</form>
in my css file i've added rules to eliminate any borders:
form {
margin: 0;
margin-bottom: 0;
margin-top: 0;
padding: 0;
}
Heres a picture (please note that this black line goes away if i comment out the upload form) :
http://img191.imageshack.us/img191/7503/blackline.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,从您上面发布的代码来看,问题并不明显。我真的建议使用诸如 FireBug 这样的工具,它可以让您快速识别和隔离导致黑条。
安装 Firebug 后,只需将鼠标悬停在黑条上,右键单击并选择
Inspect Element
。表单标签也不能嵌套。您需要删除子页面上的表单标签才能使表单正常运行。
Unfortunately the problem isn't evident from the code you posted above. I would really recommend using a tool such as FireBug which will allow you to quickly identify and isolate the html and css causing the black bar.
Once you install firebug, just hover over the black bar, right-click and select
Inspect Element
.Form tags can also not be nested. You will need to remove the form tag on the child page for the form to function properly.