Following are some use cases and examples for this:
|
Now we can set the property like <asp:Literal ID="Literal1" runat="server" Text="<%$ AppSettings: copyright %>">asp:Literal> We can use this key "copyright" where ever we want. We can do the same in our masterpage also, but the advantage here is the setting in a centralized place. Web.config files are easy to access and understand. It will be more helpful in case of Nested master page concept. c) In addition to the above two, you can display values that are stored in resource (.resx or .resource) files in our project. Resource files are used to store information for a specific language or "language and culture" combination. Suppose we want that welcome message in our web page should display according to the language specified at run time, then we can use this. Steps for using Resource file : 1. Create a App_GlobalResources folder in the root directory. 2. Create a file WelcomeMessage.resx. 3. Now create the Name Value pair as Name: Welcome, Value:Welcome to our website!!! 4. Now set it as property of control as follows: <asp:Label id="lblResource" runat="server" text="<%$ Resources: My_Resource, Welcome %>" />
Hope this will help you. Searching has no end points. Keep searching. |
Loading
Replies
Know the answer? Post it — somebody with the same question will find it here.