如何在cs页面中使用字体样式应用字符串值? [英] how to apply string value with font styles in cs page?

查看:95
本文介绍了如何在cs页面中使用字体样式应用字符串值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

string s = "<font style=\"Bold\" size=\"12\" face=\"Times New Roman, Helvetica, sans-serif\">" + "Daily MeatSale Graph - " + Request.QueryString["branchname"].ToString() + "</font>";









请帮帮我...





please help me...

推荐答案

你不能这样做。



尝试这样......


aspx页



.BranchCss {

< pre lang =css > text-decoration:下划线;

font-size:12px;

font-family:arial;

font-weight:bold;

颜色:#EB8227< / pre> ;;



}







< asp:label id =lblBranchrunat =servertext =xmlns:asp =#unknown>



aspx.cs页面



string strBranch = Request.QueryString [branchname]。ToString();

lblBranch.Text = strBranch;

lblBranchCssClass =BranchCss;
you can't do it like this.

try like this...

aspx page

.BranchCss{
<pre lang="css">text-decoration: underline;
font-size: 12px;
font-family: arial;
font-weight: bold;
color: #EB8227</pre>;

}



<asp:label id="lblBranch" runat="server" text="" xmlns:asp="#unknown">

aspx.cs page

string strBranch = Request.QueryString["branchname"].ToString();
lblBranch.Text = strBranch;
lblBranchCssClass = "BranchCss";


亲爱的 -

请在下面查看链接。



单引号,在c#string 中用双引号括起来[ ^ ]
Dear--
Please check below link.

single quotes with in double quotes in c# string[^]


这篇关于如何在cs页面中使用字体样式应用字符串值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆