tags:

views:

40

answers:

1

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'

A: 

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

tvanfosson
I don't know what that means, but I do know that I'm not allowed to change the page language because it will cause every other page to breakdown... Is there a way to do what I want in this language?
n00b0101
Have you tried `<% if (o_handler.renderDesc() != "" ) %>` -- that's two double quotes with no space between them.
tvanfosson