Combining Strings in ASP.NET Attributes

后端 未结 3 1335
情深已故
情深已故 2021-01-13 14:22

I am trying to concat a string inside the attribute. I get an error. I think that it is related to my Eval. Is there a proper way to concat strings, or is this

3条回答
  •  花落未央
    2021-01-13 14:49

    Here's what I do when I have something in a gridview like this:

    Disabilities
    

    [CS code-behind]

    public string GetDisImageLink(string dis)
    {
        return "../../Content/Images/CardContactInfo/" + 
           (dis.Trim() == "Y" ? "DIS.png" : "Blank.png");
    }
    

提交回复
热议问题