如果值为空,我想显示它会显示一些值
代码是
<p>
<strong>Preferred Industry:</strong>
<%Obj.Models.JobPreferredIndustry ji = new Obj.Models.JobPreferredIndustry(); %>
<%if (ji.IndustryId!=0)
{ %>
<% foreach (Obj.Models.JobPreferredIndustry jpi in Model.JobPreferredIndustries)
{ %>
<% if (jpi.IndustryId != null)
{ %>
<%:jpi.Industry.Name%>
<%}
else
{ %>
<%:jpi.IndustryId == null ? "Any" : jpi.Industry.Name%>
<% } %>
<% } %>
<%} else { %>
<%:"Any"%>
<% } %>
</p>
但是上面的代码总是只显示“Any” ..我做错了吗?请帮我?