我正在动态创建我的网页,因为数据总是在变化。
我有一行包含带超链接的列。如果我在浏览器中查看而不使用我的代码,它可以很好地工作。当我尝试从后面的代码运行时,链接不显示。只有
的背面颜色这是我创建行
背后的代码strTable += "<tr id=""Row1_EventName"" style=""height: 19pt; width:100%"" runat=""server"">"
strTable += "<td id=""Elem1_Name"" runat=""server"" colspan=""16"" class=""xl6620798"" style=""width:48.48%"">"
strTable += "<asp:HyperLink runat=""server"" NavigateUrl=""" & strElem1_ChartLink & """ Text=""" & strElem1_Name & """ ToolTip=""" & strElem1_EventDirectionDesc & """ ForeColor=""Blue"" Width=""100%"" />"
strTable += "</td>"
strTable += "<td Class=""xl1520798"" style=""width:3.03%""></td>"
If strElem2_Name <> "" Then
strTable += "<td id=""Elem2_Name"" runat=""server"" colspan=""16"" class=""xl6620798"" style=""width:48.48%"">"
strTable += "<asp:HyperLink runat = ""server"" NavigateUrl=""" & strElem2_ChartLink & """ Text=""" & strElem2_Name & """ ToolTip=""" & strElem2_EventDirectionDesc & """ ForeColor=""Blue"" Width=""100%"" />"
strTable += "</td>"
Else
strTable += "<td colspan=""16"" class=""xl1520798"" style=""width:48.48%""></td>"
End If
strTable += "</tr>"
css代码如下:
.xl1520798 {
padding-top: 1px;
padding-right: 1px;
padding-left: 1px;
color: black;
font-size: 9.0pt;
font-weight: 400;
font-style: normal;
text-decoration: none;
vertical-align: bottom;
white-space: nowrap;
}
.xl6620798 {
padding-top: 1px;
padding-right: 1px;
padding-left: 1px;
color: black;
font-size: 9.0pt;
font-weight: 400;
font-style: normal;
text-decoration: none;
text-align: center;
vertical-align: bottom;
background: #B8CCE4;
white-space: nowrap;
}
以下是我运行页面时的样子: