Creating Resources From a Web Page
The following feature is not available with Visual Web Developer Express.
To generate a local resource file from an ASP.NET Web page
- Open the page for which you want to create a resource file.
- Switch to Design View.
- In the Tools menu, click Generate Local Resource.Visual Web Developer creates the App_LocalResources folder if it does not already exist. Visual Web Developer then creates the culturally neutral base resource file for the current page, which includes a key/name pair for each control property or page property that requires localization. Finally, Visual Web Developer adds a meta attribute to each ASP.NET Web server control to configure the control to use implicit localization. For more information about implicit and explicit localization, see ASP.NET Web Page Resources Overview and How to: Use Resources to Set Property Values in Web Server Controls.Note:{Do not attempt to embed a graphic directly in a resource file because controls will not read the resource string as a streamed image file. Resource files represent graphics by storing the URL of the graphic as a string.}
- If the latest resource changes are not displayed, refresh Design view by switching to Source view and then switching back to Design view.
- Create resource files for additional languages by following steps 6 and 7 in the preceding procedureAdd Values to resource fileOpen with xml(text)Editthen<data name="PasswordError" xml:space="preserve"><value>Password or user name is invalid</value></data>Call Resource file value in code-behindStrings.PasswordErrorMVC Razor side@Strings.PasswordError
No comments:
Post a Comment
If any doubt?then please comment in my post