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

前端 未结 8 2225
日久生厌
日久生厌 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-04 08:52

    I was having the same issue, and I solved it by using this option instead:

    Text="<%= HttpContext.GetGlobalResourceObject("Resource", "lw_name") %> <%= HttpContext.GetGlobalResourceObject("Resource", "lw_required") %>"
    

    For local Resources, use the GetLocalResourceObject method instead of GetGlobalResourceObject

提交回复
热议问题