kamagra how much to take

Geo-Compliant Layouts Coding

On occasion, you may encounter the requirement when doing SharePoint development to return a string that represents the path to your SharePoint layouts directory supplemented with your suffixed locale ID (i.e. English being 1033). Generally, this becomes important when developing applications that may be used for a geographically disperse deployments. I would encourage you not to hard-code these values into your custom development so as to keep your custom development extendable and adaptable to an expanding environment that may cross language barriers.

Instead, use a publically accessible static string that takes an SPWeb object as a parameter to represent the root site to construct the URL. The first task within the string construction is to get another string that represents your current language by using the CultureInfo class which provides functionality about an arbitrary culture. You can look up specific culture resources at run-time by using CurrentUICulture, and return an integer representation of the culture ID by using the LCID property, lastly parsing it out to a string with the ToString() method.

  1. string localeID = CultureInfo.CurrentUICulture.LCID.ToString();

Follwing, you can return the URL represenation of the local ID by returning a string that includes the generalized path to the layouts directory (it really doesn’t exist anywhere besides _layouts), the site parameter passed in from the method, and the localeID that was established with the previous string decleration.

  1. return string.Format("{0}/_layouts/{1}/", mySPsite.Url, localeID);

Then you can consume your new string within other methods as you see fit. This can be very useful when you are pooling pages out of the layouts directory and passing in a unique ID to represent a record to be displayed on a SharePoint listform. Meaning, you could at run-time represent the appropriate path to your relevant layouts directory, and then pass in something like a SharePoint field ID into a listform page, to consume or redirect user records within other applications.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>