InitParams Helper throws ArgumentException

It is not necessary to use SilverlightInitParamsHelper, but if you decided to use it, you should know format of this parameter:

private void ParseInitParams(string initParams)
{
    string[] parameters = initParams.Split(';');
    if (parameters.Length == 0)
    {
        throw new ArgumentException("SilverlightInitParamsHelper::ParseInitParams( initParams )");
    }
 
    for (int i = 0; i < parameters.Length; i++)
    {
        ParseParameter(parameters[i].Split('='));
    }
}
 
private void ParseParameter(string[] vals)
{
    if (vals.Length != 2)
    {
        throw new ArgumentException("SilverlightInitParamsHelper::ParseInitParams( initParams )");
    }
 
    string paramName = vals[0].Trim().ToLower();
 
    if (paramName == "serviceurl")
    {
        ServiceUrl = vals[1];
    }
    else if (paramName == "debugmode")
    {
        DebugMode = ParseDebugModeValue(vals[1]);
    }
    else
    {
        throw new ArgumentException("SilverlightInitParamsHelper::ParseInitParams( initParams ), Unknown parameter name");
    }
}
Please make sure that the line in the Silverlight application corresponds to the limitations described above.
HtmlPage.Plugin.GetProperty("initParams").ToString()
Also, please make sure that asp.net page has the code necessary for its formatting:
<param name="initParams" value='ServiceUrl=<%= String.Format("http://{0}{1}", Request.Url.Authority, ResolveUrl("~/ReportService.svc")) %>;DebugMode=Full' />

Add Feedback