Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 子字符串代码在c中不起作用_C#_Asp.net - Fatal编程技术网

C# 子字符串代码在c中不起作用

C# 子字符串代码在c中不起作用,c#,asp.net,C#,Asp.net,我写了以下代码行: <asp:Label ID="lblDetail" runat="server" Text='<%#_14Communities.Web.CODEFILES.SECUREFILES.WebUtility.LimitString(Server.HtmlDecode((string)Eval("Purpose")).ToString().Replace("\n","<br/>"),200) %>'></asp:Label> 现在我

我写了以下代码行:

<asp:Label ID="lblDetail" runat="server" Text='<%#_14Communities.Web.CODEFILES.SECUREFILES.WebUtility.LimitString(Server.HtmlDecode((string)Eval("Purpose")).ToString().Replace("\n","<br/>"),200) %>'></asp:Label>

现在我只想显示200个字符。它不起作用

您可以使用简单的内在dotNet函数子字符串


请提供一个更好的描述什么出了问题。是ASP还是C?实际发生了什么,是否有错误消息或异常?它可能会帮助您引用此检查限制字符串。显然,它不起作用 communities.Web.CODEFILES.SECUREFILES.WebUtility.LimitString方法的作用是什么?你能提供那个方法的代码吗?
yourString.Substring(0, 200);