Asp.net IE9显示空值

Asp.net IE9显示空值,asp.net,asp.net-mvc,Asp.net,Asp.net Mvc,在我的模型中,我定义了NullDisplayFormat [StringLength(100)] [DisplayName("First Contact")] [DisplayFormat(NullDisplayText = "")] [Column("Contact1",TypeName = "varchar")] public virtual string Contact1 { get; set; } 在Google Chrome和FireFox中,我在视图中的网格和输入控件中看不到任何

在我的模型中,我定义了NullDisplayFormat

[StringLength(100)]
[DisplayName("First Contact")]
[DisplayFormat(NullDisplayText = "")]
[Column("Contact1",TypeName =  "varchar")]
public virtual string Contact1 { get; set; }
在Google Chrome和FireFox中,我在视图中的网格和输入控件中看不到任何内容。然而,在IE9中,我看到NULL。这是IE9中的一个bug吗?最简单的修复方法是什么

我还尝试在jQuery中以这种方式将null更改为nothing:

var Contact1 = $('.trSelected td:eq(3)').text();
$('#Contact1').val(Contact1||'Nothing');
但是,由于Contact1已经是字符串属性=null,因此它不起作用。你知道我怎么修吗


提前感谢。

问题在于使用JSON在网格中显示。因此,我修改了返回的代码,例如

 var flexgrid = new
            {
                page = page,
                total = Total,
                rows = clients
                .Select(x => new
                {
                    id = x.Id,

                    cell = new { Id = x.Id, Number = x.Number, Name = x.Name, Contact1 = x.Contact1.Contact ?? String.Empty }
                }
                )
            };

            return Json(flexgrid, JsonRequestBehavior.AllowGet);
可能DisplayFormat仅适用于在单个控件中查看/编辑此控件,而不是在我们将其作为集合返回时。有趣的是,Google Chrome和FireFox将NULL显示为空字符串