TAILIEUCHUNG - Professional ASP.NET 3.5 in C# and Visual Basic Part 145

Professional in C# and Visual Basic Part 145. Building on the revolutionary release, adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 30 Localization create a resource file that can be utilized across the entire application right-click on the solution in the Solution Explorer of Visual Studio and select Add New Item. From the Add New Item dialog select Resource file. Selecting this option provides you with a file. Visual Studio places this file in a new folder called App_GlobalResources. Again this first file is the invariant culture resource file. Add a single string resource giving it the key of PrivacyStatement and a value of some kind a long string . After you have the invariant culture resource file completed the next step is to add another resource file but this time name it . Again for this resource file give a string key of PrivacyStatement and a different value altogether from the one you used in the other resource file. The idea of a global resource file is that you have access to these resources across your entire application. You can gain access to the values that you place in these files in several ways. One way is to work the value directly into any of your server control declarations. For instance you can place this privacy statement in a Label server control as presented in Listing 30-17. Listing 30-17 Using a global resource directly in a server control asp Label ID Label1 runat server Text Resources Resource PrivacyStatement asp Label With this construction in place you can now grab the appropriate value of the PrivacyStatement global resource depending upon the language preference of the end user requesting the page. To make this work you use the keyword Resources followed by a colon. Next you specify the name of the resource file class. In this case the name of the resource file is Resource because this statement goes to the and files in order to find what it needs. After specifying the particular resource file to use the next item in the statement is the key in this case PrivacyStatement. Another way .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.