1

I have a silverlight project that has many xaml pages. i have an external website that will call the silverlight website so e.g. http://mysilverlightproject:1230.com?queryString1=Page1.xaml.

i want to change the page by passing the values from query string.

is it possible to change the main xaml page to be another page from the query string?

Thanks

4 Answers 4

3
string val = string.Empty;
if (HtmlPage.Document.QueryString.ContainsKey(”foo”))
{val = HtmlPage.Document.QueryString["foo"];}
Sign up to request clarification or add additional context in comments.

Comments

1

As far as I know you can't change Main page after it is assigned from App class. But you can use Navigation framework and navigate to needed page. In this case you also will be able to use browsers back/forward button.
This post is about navigating from code behind.

Comments

0

Take a look at how a Silverlight Navigation Application works. It will give you the functionality you request.

Comments

0

you can pass pageId to SL application by initparams specific to different URLs and load required page inside SL application instead of default start page

Init params are placed in html and are passed inside SL app, like the following

<param name="InitParameters" value="queryString=Page10" />

Inside you can use SilverlightHost class to get them

        SilverlightHost host = new SilverlightHost();
        if (host.InitParams.Count > 0)
        {
            foreach (var c in host.InitParams)
            {
                if(c.Key == "queryString")
                  RedirectToUIPage(c.Value) // your method
            }
        }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.