Skip to main content

Microsoft Silverlight

Unanswered Question Page navigation between silverlight pages[XAML & HTML]RSS Feed

(0)

mangesh.v.s
mangesh.v.s

Member

Member

8 points

6 Posts

Page navigation between silverlight pages[XAML & HTML]

We are implementing 'Isolated feature of silverlight'  for our website.we are keeping some user information on client side through Isolated feature of silverlight. And we want to retrieve those information again.

Using TestPage.html and Page.xaml we are able to store the information on client machine in isolated storage area.

To retrieve information from isolated storage file we have added one html & xaml page to our project.

To redirect from TestPage.html to newly added html page we have written one javascript function on 'TestPage.html' but its fetching error 'Permission Denied.'

Following Js code we have used to redirect to  another page

window.location.href="RetrievePage.html ";

we have also tried window.open ,But facing same error

Can we retrive the information that is store in the isolated file after Browser is closed or any time we require from same file

luisabreu
luisabreu

Participant

Participant

1676 points

612 Posts

Re: Page navigation between silverlight pages[XAML & HTML]

hello.

well, changing the location of your window should be enough...does the error happen when you load the html page or when your silverlight code that retrieves the isolated storage content runs?

mangesh.v.s
mangesh.v.s

Member

Member

8 points

6 Posts

Re: Page navigation between silverlight pages[XAML & HTML]

see actually what i am doing is

I am saving data to isolated file on testpage.html(the default html page of silverlight project)

And trying to retrive the same data on another htlm page as that I added (by add new item)

IN default html page we are calling a java script function,which is supposed to redirect us to other html page.

 we have defined textblock 

and on the textblocks click event I am calling the js function

And through this function we are trying to go to the added html page using

windows.location.href="page name"And also tried wondows.open

And i get the error when this function is executed 

 

swirlingmass
swirling...

Participant

Participant

1348 points

385 Posts

Re: Page navigation between silverlight pages[XAML & HTML]

Are you running it in a hosted environment?  If not, it's denying you access because you don't have access to local files.

mangesh.v.s
mangesh.v.s

Member

Member

8 points

6 Posts

Re: Page navigation between silverlight pages[XAML & HTML]

we are running the application on our local machine i.e client & server is the same for application. 

we are using visual studio 2008 beta2 ( vista machine) template for silverlight application.The default page for silverlight application is 'TestPage.html' as follow  : code for that is as follow

we are calling js function callfun() on body onload event of 'TestPage.html' to redirect to 'nextPage.html' which fetchs error 'Permission Denied'.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<!-- saved from url=(0014)about:internet -->

<head>

<title>Silverlight Project Test Page </title>

 

<script type="text/javascript" src="Silverlight.js"></script>

<script type="text/javascript" src="TestPage.html.js"></script>

<style type="text/css">

.silverlightHost { width: 640px; height: 480px; }

</style>

<script type="text/javascript">

function callfun()

{

window.location.href = "nextPage.html";

}

</script>

</head>

<body onload="callfun()">

<div id="SilverlightControlHost" class="silverlightHost" >

 

</div>

</body>

</html>

 

 

 

justncase80
justncase80

Member

Member

349 points

144 Posts

Re: Re: Page navigation between silverlight pages[XAML &amp; HTML]

I changed "nextPage.html" to "http://www.google.com/" and it worked fine, maybe the problem is that you need to have the full url instead of a relative url?

swirlingmass
swirling...

Participant

Participant

1348 points

385 Posts

Re: Page navigation between silverlight pages[XAML & HTML]

Maybe someone else can explain this better than I can.  Visual studio doesn't run the Silverlight html files on its development server.  So when you go to debug, you're not in a hosted environment.  Probably the easiest way to get in a hosted environment is to add a new project/web site (aspx page) to your solution, right click on it, and select Add Silverlight Link.  Then run it from the aspx page.

Let's see if I can explain it another way.  If it's not hosted, nextPage.html is really something like C:/somedirectorypath/nextPage.html.  You're not going to have access to anything on c:, you need it to be http.  In a hosted environment, nextPage.html really means something like http://localhost/nextPage.html.

mangesh.v.s
mangesh.v.s

Member

Member

8 points

6 Posts

Re: Re: Page navigation between silverlight pages[XAML &amp; HTML]

 Hi,

Yes i have also tried the same "http://www.google.com/" and it works

But if go and add a html page in my silverlight project

and call the same html page using windows.location.herf="html page name" then it gives error 

is  windows.location.herf=" " a correct way?

or any idea hoe to call the other html which is in same project.

And how to integrate this silverlight project to my existing web apllication which is developed in asp.net 

jasonxz
jasonxz

Participant

Participant

1752 points

530 Posts

Re: Re: Page navigation between silverlight pages[XAML &amp; HTML]

Actually, I believe it's window.location="nextPage.html".

Have you tried window.location="http://www.google.com" or window.location="default.html"?

Also, if you're working on your asp.net website in VS2K8, you can right-click your website and click "Add Silverlight link" to integrate your Silverlight project with your asp.net website.

mangesh.v.s
mangesh.v.s

Member

Member

8 points

6 Posts

Re: Re: Page navigation between silverlight pages[XAML &amp; HTML]

Actually, I used window.location.href="nextPage.html".not window.location=" "

I tried window.location.href="http://www.google.com" ,it works

I will try to"Add Silverlight link" to integrate your Silverlight project with your asp.net website.

 

thanks for your valuable response

 

nirav123
nirav123

Member

Member

6 points

5 Posts

Re: Re: Re: Page navigation between silverlight pages[XAML &amp;amp; HTML]

Hi! I am being troubled as i want the code thru which we can navigate between XAML pages.I am using SilverLight 2 Beta 2.All the stuff on net gives the code in C# which works fine but when i convert it in VB,results are changed.If anybody had got code for it plz help me out. 

lijoputhuval
lijoputh...

Member

Member

108 points

51 Posts

Re: Re: Re: Page navigation between silverlight pages[XAML &amp;amp; HTML]

try this

here am closing one page by clicking the button.

 and am calling my Default.xaml here.

private void btnExit_Click(object sender, RoutedEventArgs e)

{
this.Content = new Default();

}

if this help u pls mark it as answer

with Regards
Lijo

zperic
zperic

Member

Member

2 points

1 Posts

Re: Re: Re: Re: Page navigation between silverlight pages[XAML &amp;amp; HTML]

lijoputhuval thanx a lot for help...

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities