How do I concatenate 2 resource strings together in an aspx page

前端 未结 8 2144
日久生厌
日久生厌 2021-01-04 08:27

I have a localised ASP.net application (.net 2.0). I wish to concatenate 2 strings retrieved from the resource file together into one element, something like this.



        
相关标签:
8条回答
  • 2021-01-04 09:09

    < asp:HyperLink ToolTip='<%# "Some Text :" + Eval("id").ToString() %>' ....../>

    Do you mean something like this.... ToolTip='...' -> Convert your return values to STRING... ( xxxx.ToString() )

    Like this it displays: Some Text: 1234 --> on Tooltip

    so you should do something like this in your case: Text="<%$ (Resources:Resource, lw_name).ToString() %>" + <%$ (Resources:Resource, lw_required).ToString() %>"

    I don't know if it's going to work but try to conver to ToString().

    0 讨论(0)
  • 2021-01-04 09:15

    ASP.NET tag attribute values that use <%$ Something: Something Else %> are of a special syntax called ASP.NET Expressions. Using them as attribute values are pretty much all-or-nothing; there's no way to add any code into the ASPX file to manipulate what those expressions evaluate to. You'll have to do this in the code-behind.

    0 讨论(0)
提交回复
热议问题