Reading URL-parameters in Silverlight

There are two ways to read URL-parameters in Silverlight. Today I am going to show you one, and the easiest according to me.

In CRM there is a setting that you can “pass-param”. If you are on a CRM Form you get keys like “typename” and “id”.

Complete list (CRM 2011):

Parameter Name Description
typename Entity Name Name of the entity
type Entity Type Code Integer that uniquely identifies the entity in a specific organization
id Object GUID GUID that represents a record.
orgname Organization Name Unique name of the organization.
userlcid User Language Code Language code identifier that is being used by the current user.
orglcid Organization Language Code Language code identifier that represents the base language for the organization.



If you have the Silverlight in the Sitemap you don’t get (of course), typename, type and id.

You can read them in your Silverlight:

 1: IDictionary<string, string> QueryString = HtmlPage.Document.QueryString;
 2: string orgname, entityname;
 4: if (QueryString.ContainsKey("orgname"))
 5:     orgname = QueryString["orgname"];
 7: if (QueryString.ContainsKey("typename"))
 8:     entityname = QueryString["typename"];
This entry was posted in CRM 2011, CRM 4, MS CRM and tagged , , . Bookmark the permalink.

One Response to Reading URL-parameters in Silverlight

  1. Rodrigo says:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s