mvc3如何验证操作链接的链接文本为空 [英] mvc3 how to verify the link text null of the action link

查看:80
本文介绍了mvc3如何验证操作链接的链接文本为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有@Html.ActionLink(((object)item.EntityName).ToString().

如何验证实体名称是否为空.

即操作链接文本为空验证.

提前谢谢.
Pavan.

Hi All,

I have @Html.ActionLink(((object)item.EntityName).ToString().

How can I verify whether the Entity name is null or not.

I.e Action link text null verification.

Thanks in advance.
Pavan.

推荐答案

您是否拥有扩展名ActionLinkIfNotNull.在该扩展名中,如果字符串不为null(或为空),则只需返回原始字符串,否则返回空字符串.
Do you own extension ActionLinkIfNotNull. In that extension, you would simply return the original string if the string is not null (or empty) and an empty string other wise.


这篇关于mvc3如何验证操作链接的链接文本为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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