开发者

asp - Cannot find method 'IsNullOrEmpty(String)' in 'String'

Trying to only print if a string isn't empty, and am using the code below, but it keeps coming up with that error...

<%if(!String.IsNullOrEmpty(o_handler.renderDesc())) { %>
                        <strong>Description:</strong><BR>
                        <HR SIZE="1">
                        <strong><%= o_handler.renderDesc()%></strong>
                        <HR SIZE="1">
                        <BR>
<%} else { %>

<%}%>

Also tried this:

<%if( o_handler.renderDesc() != null ) { %>
                        <strong>Description:</strong><BR>
                        <HR SIZE="1">
                        <strong><%= o_handler.renderDesc()%></strong>
                        <HR SIZE="1">
                        <BR>
                    <%} else { %>
开发者_高级运维
                    <%}%>

Here's the error:

Compiler Error Message: VJS1223: Cannot find method 'IsNullOrEmpty(String)' in 'String'


Looks like your page language is set to JScript. Try setting it to C#.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜