James King James King - 3 years ago 239
ASP.NET (C#) Question

Concatenating text in an ASP.NET localized label

Trying to localize text in ASP.NET labels... want to add a ':' after the localized text. I could just add the ':' to the localized text in the resource file, but that seems silly... there should be an easy way to do this.

<asp:Label id="RoleTypeLabel" runat="server" Text='<%$ Resources: GS3, RoleTypeLabel %>:' AssociatedControlID="RoleTypeDropDown"></asp:Label>

(note the ':' at the end of Text='...')

Of course, this doesn't work... and neither does anything I can think of to concatenate a ':' onto the end of the localized text.

Anyone know how to do it?


Answer Source

I've always put the colon outside the label.

<asp:Label ID="RoleTypeLabel" runat="server" Text="<%$ Resources: GS3, 
RoleTypeLabel %> />:
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download