I am trying to show a placeholder in ASP.NET textbox control to show a hint for the user that added sccuddfully as answerd at How to add placeholder in ASP.NET Textbox. but now I need to know How can I show dynamic hint placeholder from Resources.resx file based on the current site language?
belwo I need to show the placeholder hint text in another language based on my resourcefile.resx, How to do that?
You can show the placholder attribute value from a resource file using <%$Resources:ResourceFile,Title%> as below:
<asp:TextBox CssClass="form-control" ID="txt_name" placeholder="<%$Resources:ResourceFile,Title%>" runat="server"></asp:TextBox>
Additionally, you can set the placeholder attribute in a code-behind using C# as below
txt_name.Attributes["placeholder"] = YourResource_fileName.ResourceManager.GetString("Resource Key");
Most popular tags