简体   繁体   中英

Passing parameters from aspx page to xmal page

i am developing a site using asp.net but for displaying graphs we are using silverlight technology.

i am able to navigate to a silverlight page using navigateurl of link button and i am able to attach query string for that, but how can i retrieve query string parameters in silverlight .xmal page.

if there are so many alternative ways to pass parameters please give a link of those.

last but not least i have a back button on silverlight .xmal page if user click on that back button i need to redirect him to aspx page, how can i achieve that?

thank you in advance

this is how you can get query string in silverlight

 public static string GetQueryStringValue(this System.Windows.Controls.Page page, string p)
        {

            var values = HtmlPage.Document.QueryString
            .Where(w => w.Key.Trim().Equals(p))
            .Select(s => s.Value).SingleOrDefault();
            return values;
        }

        public static string GetQueryStringValueFromNavigationContext(this System.Windows.Controls.Page p, string key)
        {
            var values = p.NavigationContext.QueryString
            .Where(w => w.Key.Trim().Equals(key))
            .Select(s => s.Value).SingleOrDefault();
            return values;
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM