<ItemTemplate>
<div class="Hr_title">
<asp:Label ID="Label1" runat="server" Text='<%# Bind("bookname") %>'></asp:Label>
</div>
<div class="Hr_content">
<asp:Label ID="Label2" runat="server" Text='<%# Bind("explain") %>'></asp:Label>
</div>
</ItemTemplate>.Hr_title
{
font-size: 110%;
font-weight: bold;
line-height: 35px;
text-align: left;
text-indent: 15px;
overflow: hidden;
color: #333333;
width: 100%;
height: 35px;
margin-bottom: 5px;
}
.Hr_content
{
line-height: 30px;
text-align: left;
text-indent: 25px;
}在程序里面看是没问题的, 调试或放到服务器上就没作用了
<div class="Hr_title">
<asp:Label ID="Label1" runat="server" Text='<%# Bind("bookname") %>'></asp:Label>
</div>
<div class="Hr_content">
<asp:Label ID="Label2" runat="server" Text='<%# Bind("explain") %>'></asp:Label>
</div>
</ItemTemplate>.Hr_title
{
font-size: 110%;
font-weight: bold;
line-height: 35px;
text-align: left;
text-indent: 15px;
overflow: hidden;
color: #333333;
width: 100%;
height: 35px;
margin-bottom: 5px;
}
.Hr_content
{
line-height: 30px;
text-align: left;
text-indent: 25px;
}在程序里面看是没问题的, 调试或放到服务器上就没作用了
解决方案 »
- Asp.net 中显示消息框的问题
- 解密sqlserver 2005的存储过程.....
- asp.net 上传图片功能
- 银联在线相关,开发过电子商务的来指导下、
- 有什么办法可以让MasterPage局部刷新?高分相送150分
- 上传文件的问题,在线等。
- 从客户端(ContentHtml="<!-- warning.htm -->...")中检测到有潜在危险的 Request.Form 值?
- 为什么网页打开一段时间后,关闭打开后显示用户访问过多
- 那里有免费的空间啊!要不收费的也行啊!
- 请教高手: 我有一台WEB服务器, 只打了win2k-SP3和SQL2K-SP3, 其他一些补药我都未吃, 这样是否安全? 因为全打上机器感觉要慢1/3. 谢谢!!!
- 用C#实现生成PDF文档
- 在线求三层体系完整的DBHelper类
应该是可以的
default.aspx<%@ Page Language="VB" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<ItemTemplate>
<div class="Hr_title">
<asp:Label ID="Label1" runat="server" Text='abc'></asp:Label>
</div>
<div class="Hr_content">
<asp:Label ID="Label2" runat="server" Text='def'></asp:Label>
</div>
</ItemTemplate> </form>
</body>
</html>
stylesheet.cssbody {
}
.newStyle1
{
}
.Hr_title
{
font-size: 110%;
font-weight: bold;
line-height: 35px;
text-align: left;
text-indent: 15px;
overflow: hidden;
color: #ff0000;
width: 100%;
height: 35px;
margin-bottom: 5px;
}
.Hr_content
{
line-height: 30px;
text-align: left;
text-indent: 25px;
}
楼主是不是设置了span的内容,label在客户端生成的html是span,可能是span样式被设置过了一般不需要使用label来显示数据了,这样生成多余的html代码,直接绑定就可以了 <ItemTemplate>
<div class="Hr_title">
<%# Bind("bookname") %>
</div>
<div class="Hr_content">
<%# Bind("explain") %>
</div>
</ItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("bookname") %>'></asp:Label>
</ItemTemplate>
<ItemStyle CssClass="Hr_title" />
</asp:TemplateField>
<asp:TemplateField HeaderText="名称two">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("explain") %>'></asp:Label>
</ItemTemplate>
<ItemStyle CssClass="Hr_content" />
</asp:TemplateField>