Passing Parameters to a URL Using SiteMap for a Multilingual solution

In order to host a web page in the MS CRM sitemap, where the virtual directory resides on the IIS (or specifically in the MS CRM Directory, as is the case with an ISV solution), you are required to export the sitemap, add a SubArea element to the sitemap xml, and then re-import the edited file.

In case it’s a single language solution, you can specify the URL as
http://myserver/mypage.aspx?orgname=AdventureWorksCycle&userlcid=1033&orglcid=1033

However, if your solution supports more than one languages for the user, you will need to get the userlcid parameter on the page in order to render it based on the user’s currently set language (you cannot simply set it to “userlcid=1033”).
Setting the PassParams parameter to 1 in the SubArea tag does this:

<SubArea Id="MyCustomArea" Icon="/_imgs/Icon.gif" PassParams="1" Url="/../ISV/MyCustomSite /HomePage.aspx" Client="Web">

You can then use the page’s querystring in order to read the userlcid parameter:
currentLanguageCode = Request.QueryString["userlcid"].ToString();

Comments

  1. What if I need to get the currently logged in user's ID?

    ReplyDelete

Post a Comment

Popular posts from this blog

The key specified to compute a hash value is expired, only active keys are valid.

IFD Implementation for custom web pages and Anonymous Access

Using CRM Services to create or update records in large numbers