Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a resource file for all the text used in my website. now I want to add a string like 'Your Full Name *' where Your Full Name is from resource file. I can't use star in the resource file. Will i be able to append it?


This is my current code : <asp:Label ID="lblName" runat="server" AssociatedControlID="txtName" Text="<%$ Resources:Registration, YourFullName%>" >
Thanks in advance.

Pleas let me know if you need clarification
Posted
Updated 20-Feb-14 19:11pm
v2

Try like this

ASP.NET
<asp:Label ID="lblName" runat="server" AssociatedControlID="txtName" Text="<%$ Resources:Registration, YourFullName%>" ><span>*</span>

you can apply style if you want to make it red for compulsory or something like that
 
Share this answer
 
v5
1)In your resource file the usage of the * char is possible, at least in .NET4.0. So you should have no problem in setting the value in your resource file.
2)To append other value in ASPX file is not possible, but you could init your label in the Page_Load() event like in the next code:
C#
protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                  _lblName.Text = Resources.Registration.YourFullName + "*";
             } 
 //...
        }
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900