- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
asp.net code 128 barcode Implementing personalization and localization in .NET framework
Implementing personalization and localization Code 128 Code Set A Generation In Visual Studio .NET Using Barcode generator for ASP.NET Control to generate, create Code 128 image in ASP.NET applications. www.OnBarcode.comLinear Barcode Creation In Visual Studio .NET Using Barcode printer for ASP.NET Control to generate, create 1D image in ASP.NET applications. www.OnBarcode.comFigure 7.15 Setting our preferred language to Spanish in Firefox
Barcode Creation In .NET Using Barcode creation for ASP.NET Control to generate, create Barcode image in ASP.NET applications. www.OnBarcode.comGTIN - 128 Drawer In .NET Framework Using Barcode generator for ASP.NET Control to generate, create GS1-128 image in ASP.NET applications. www.OnBarcode.comHere we re using Mozilla Firefox, though all major browsers will allow you to do this. In Firefox, select Tools > Options > Content (tab) > Languages and you can choose your language preference. Figure 7.15 shows that we ve added Spanish (es-ES) to the list and moved it to the top. You ll also need the Web.config setting shown in listing 7.14. PDF417 Generator In .NET Framework Using Barcode creation for ASP.NET Control to generate, create PDF 417 image in ASP.NET applications. www.OnBarcode.comCreating Barcode In Visual Studio .NET Using Barcode creation for ASP.NET Control to generate, create Barcode image in ASP.NET applications. www.OnBarcode.comListing 7.14 Enabling autoculture selection from the browser
Paint QR Code In .NET Using Barcode drawer for ASP.NET Control to generate, create QR Code 2d barcode image in ASP.NET applications. www.OnBarcode.comGenerate 2 Of 5 Industrial In VS .NET Using Barcode encoder for ASP.NET Control to generate, create Code 2 of 5 image in ASP.NET applications. www.OnBarcode.com<system.web> ... <globalization enableClientBasedCulture="true" uiCulture="auto" culture="auto" /> </system.web> Code-128 Recognizer In None Using Barcode decoder for Software Control to read, scan read, scan image in Software applications. www.OnBarcode.comPrint Code 128C In VB.NET Using Barcode maker for .NET Control to generate, create Code 128B image in VS .NET applications. www.OnBarcode.comWhen you enable the culture setting, ASP.NET can apply globalization when the application runs. After doing this, our browser will submit the culture we prefer to the server. The server reads this and returns the localized resources (if they re available, of course). Figure 7.16 shows that after refreshing the browser, we re greeted with Spanish messages. Printing DataMatrix In None Using Barcode creator for Online Control to generate, create DataMatrix image in Online applications. www.OnBarcode.comEncoding USS-128 In Java Using Barcode drawer for Java Control to generate, create UCC-128 image in Java applications. www.OnBarcode.comViewing the site with a different preferred language setting in the browser
Encoding Code 39 In VB.NET Using Barcode creation for .NET framework Control to generate, create Code39 image in Visual Studio .NET applications. www.OnBarcode.comPaint ECC200 In Objective-C Using Barcode creation for iPad Control to generate, create Data Matrix ECC200 image in iPad applications. www.OnBarcode.comLeveraging existing ASP.NET features
Generate Barcode In .NET Framework Using Barcode generator for .NET Control to generate, create Barcode image in Visual Studio .NET applications. www.OnBarcode.comEncode Data Matrix 2d Barcode In Java Using Barcode maker for Java Control to generate, create Data Matrix image in Java applications. www.OnBarcode.comThe content region of the page has also been localized. To add local resources for a single page, which are accessible on the view, add an App_LocalResources folder next to the .aspx files. Figure 7.17 shows this for our index view. It isn t as simple as this. Remember that .aspx views residing in the Views folder is all just convention. Due to the highly customizable nature of ASP.NET MVC, there s nothing to stop you from having your views be served from the database, or from another location on disk. This complicates the notion of a local resource because local is now dynamic. Luckily Matt Hawley has discovered this (the hard way) and posted his findings on his blog. You can find the post, ASP.NET MVC: Simplified Localization via ViewEngines, at http://mng.bz/6LcX. His solution involves deriving from the standard WebFormViewEngine to create a LocalizableWebFormsViewEngine. This derived class stores the Figure 7.17 Adding local resources for the view path in view data for each view, so when Index view the helper methods invoked from the view require a path, it can be taken directly from ViewData. We ll leave the rest of the details to Matt s excellent post. In these examples, we saw the basic resource API for .NET. In Web Forms, there are additional features in which server controls can declaratively display resources from the current culture. In ASP.NET MVC, none of these exist yet, but it d be trivial to create additional view helpers to accomplish this. Localization is an enormous topic, and unfortunately few developers pay attention to it. We ve just scratched the surface in this section. If you re building a site that will have users from different countries, be sure to look into localization. Painting Barcode In Java Using Barcode drawer for Java Control to generate, create Barcode image in Java applications. www.OnBarcode.comPDF-417 2d Barcode Creator In None Using Barcode creator for Software Control to generate, create PDF417 image in Software applications. www.OnBarcode.comImplementing ASP.NET site maps
Scan UPC Code In None Using Barcode reader for Software Control to read, scan read, scan image in Software applications. www.OnBarcode.comGenerate Barcode In None Using Barcode encoder for Microsoft Word Control to generate, create Barcode image in Word applications. www.OnBarcode.comThe last feature we ll visit in this section is the ASP.NET site map. A site map allows you to define the hierarchy of your site in an XML file (called Web.sitemap) or another data source of your choosing. On your pages, you can include a SitemapPath control that displays breadcrumb navigation to the users, allowing them to navigate back to higher-level pages. In ASP.NET MVC, site maps work surprisingly well. You define a sample Web.sitemap file, such as that in listing 7.15, to define the URL hierarchy of the site. You can create a site map file by choosing Sitemap in the project s Add New Item dialog box. Implementing ASP.NET site maps Listing 7.15 Defining our site structure in Web.sitemap
< xml version="1.0" encoding="utf-8" > <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="/home" title="Home" description=""> <siteMapNode url="/home/index" title="Index" description="" /> <siteMapNode url="/home/about" title="About Us" description="" /> <siteMapNode url="/home/contact" title="Contact Us" description="" /> <siteMapNode url="/home/legal" title="Legal" > <siteMapNode url="/home/legal section=privacy" title="Privacy Policy" /> <siteMapNode url="/home/legal section=terms" title="Terms & Conditions" /> </siteMapNode> </siteMapNode> </siteMap> Now that ASP.NET knows about our site s structure, we can display the current breadcrumb path to the user, using the standard SiteMapPath server control from Web Forms (listing 7.16). Luckily, this control doesn t require any server-side form tag (nor ViewState or postbacks). It renders just as you d expect it to.
|
|