locked
How to open .aspx page pop up From Silverlight Page. RRS feed

  • Question

  • I have MainPage.xaml where I have Button1.

    And in .web Project I have Page1.aspx......


    1> Now How can I Display Page1.aspx on click of Button1.

    2>Also How I can Add/Show another Silvelight user Control (say NewPage.xaml) on Page1.aspx


    3> Do I need to use IFrame????

    But I don't know anything about IFrame.



    Thanx in advance...

    Please reply soon

    Saturday, September 4, 2010 1:51 AM

Answers

  • There is a mistake in your undersanding, I believe, as I read the post.

    Silvelright is an object that comes under an aspx page (WebForm or user control)

    When you click a button in the silverlight application, if you need to call a page that resides in the server which has the page where silverlight application is embedded, then you may use the relative url to call the page else you can use the absolute

    e.g.

    You have 2 pages pages, wherein the Silverlight1 is placed as an object in Page1.aspx; You need to call page2.aspx when you click a button in Silverlight1

    ButtonClickEvet(args)

    {

    HtmlPage.Window.Navigate(new Uri("Page2.aspx", UriKind.Relative)); 

    }

    Page 2 can hold either a XAML just like you embed a XAML in the server as startup screen (Splash Screen) or use another project and add this project as an object of page2.aspx

    HTH

    You can use ASPX session to pass values between pages or you may use cookies

    Saturday, September 4, 2010 4:30 AM

All replies

  •  

    Hi,

    Try the below code

                Uri uri = new Uri(HtmlPage.Document.DocumentUri, "Data.aspx");
                string path = uri.AbsoluteUri.ToString();
                HtmlPage.Window.Eval("document.location.href='" + path + "';"); 

    Saturday, September 4, 2010 3:15 AM
  • There is a mistake in your undersanding, I believe, as I read the post.

    Silvelright is an object that comes under an aspx page (WebForm or user control)

    When you click a button in the silverlight application, if you need to call a page that resides in the server which has the page where silverlight application is embedded, then you may use the relative url to call the page else you can use the absolute

    e.g.

    You have 2 pages pages, wherein the Silverlight1 is placed as an object in Page1.aspx; You need to call page2.aspx when you click a button in Silverlight1

    ButtonClickEvet(args)

    {

    HtmlPage.Window.Navigate(new Uri("Page2.aspx", UriKind.Relative)); 

    }

    Page 2 can hold either a XAML just like you embed a XAML in the server as startup screen (Splash Screen) or use another project and add this project as an object of page2.aspx

    HTH

    You can use ASPX session to pass values between pages or you may use cookies

    Saturday, September 4, 2010 4:30 AM
  • Hi

    i want to do same thing .but when i try to access the page then the access denied permission message is shows ..but i have already given the permission to application folder

    Tuesday, June 14, 2011 3:22 AM
  • Permission might be for the incorrect users... Seach IIS Permission for more details.. you may need to give permission for ASPnet user, IISuser... etc

    Wednesday, June 15, 2011 2:09 AM