Click here to Skip to main content
16,021,125 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi....

Is it possible to change the captions of controls on web page dynamically using resource files in C# ASP.NET??
if yes,please help..
Posted

Yes, possible.

Look here on how to get a string from resource at runtime:
ASP.NET Localization (Quick Reference)[^]
 
Share this answer
 
Hi,

In resource file you can set the caption and that caption can be used from entire web applications. Set the name as id in resources and value as caption. You can provide a comment if applicable. Example:

ASP.NET
<asp:label id="Label1" runat="server" text="<%$Resources:Common, lblActiveWorklist %>"/>


Here,
Resources - Is the keyword to access the resource file.
Common - Is the name of resource file
lblActiveWorklist - Is the id of the resources of which caption you want to access.

All the best.
 
Share this answer
 
v2
hi,

You can generate the resource keys i.e. meta keys for controls and add the global resource files in to application (which contains key value).. Access value from key defined in resource file in to your code,assign value to control.
Hope this will help you!

All the best.
 
Share this answer
 

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