PDA

View Full Version : [CLOSED] how to set HyperLink's text color?



hdsoso
Oct 23, 2013, 2:54 PM
<ext:HyperLink runat="server" StyleSpec="font-weight:bold;font-color:red;" StyleHtmlCls="login_txt_style" Target="_blank" NavigateUrl="http://www.xxx.com" Text="xxxx"></ext:HyperLink>

i use above code ,not work

Baidaly
Oct 23, 2013, 4:18 PM
Hello!

Couldn't reproduce with the sample below:


<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html>
<head id="Head1" runat="server">
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:HyperLink runat="server" StyleSpec="font-weight:bold;font-color:red;" StyleHtmlCls="login_txt_style" Target="_blank" NavigateUrl="http://www.ext.net" Text="Ext.NET"></ext:HyperLink>

</form>
</body>
</html>

hdsoso
Oct 24, 2013, 1:33 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="TobrosCWT.test.WebForm2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:HyperLink ID="HyperLink1" runat="server" StyleSpec="font-weight:bold;font-color:red;" StyleHtmlCls="login_txt_style" Target="_blank" NavigateUrl="http://www.ext.net" Text="Ext.NET"></ext:HyperLink>
</form>
</body>
</html>



how to set link's text "Ext.NET"'s color to red? may be StyleSpec is apply to text's css , but how to apply a tag's css?

Baidaly
Oct 24, 2013, 2:30 AM
Sorry, I misunderstood your question. You should use Try the following:


<%@ Page Language="C#" %>

<!DOCTYPE html>

<html>
<head runat="server">
<title></title>
<style>
.login_txt_style a {
color: red;
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:HyperLink runat="server" Cls="login_txt_style" Target="_blank" NavigateUrl="http://www.ext.net" Text="Ext.NET" />
</form>
</body>
</html>