0

i have a silverlight webresource in my crm 2011. now my task is to append a data parameter in url like

https://www.............../data=1234

now in silverlight application i need to read this data parameter. i have tried to read the data

  if (App.Current.Host.InitParams["data"] != string.Empty)
            {
                string CallerNumber = App.Current.Host.InitParams["data"];

... 

and

i tried filtering the code to like

string url = System.Windows.Browser.HtmlPage.Document.DocumentUri.ToString();
            var uri = new Uri(url);
            var CallerNumber = uri.Query;

callernumber will have the ?data=1234

but still i am not able to get the data parameter. Do help

Abhishek gupta
  • 463
  • 3
  • 12
  • 33

1 Answers1

0

I believe that you will find those in the query string. You can access it like this

foreach (var item in HtmlPage.Document.QueryString)
{
    //Do something like the data
}
Kevin Ross
  • 7,185
  • 2
  • 21
  • 27