Page view counter
Page navigation between silverlight pages[XAML & HTML]
Last post 08-19-2008 7:42 AM by nirav123. 10 replies.
Sort Posts:
08-22-2007 12:10 PM
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

mangesh.v.s

Loading...
Joined on 08-22-2007
Posts 6
08-22-2007 12:14 PM
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?

luisabreu

Loading...
Joined on 04-30-2007
Posts 612
08-22-2007 2:25 PM
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 

 

mangesh.v.s

Loading...
Joined on 08-22-2007
Posts 6
08-22-2007 3:12 PM
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.

swirlingmass

Loading...
Joined on 05-02-2007
Posts 384
08-23-2007 2:00 AM
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>

 

 

 

mangesh.v.s

Loading...
Joined on 08-22-2007
Posts 6
08-23-2007 1:00 PM
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?

---
http://www.justnbusiness.com/
~justin chase

justncase80

Loading...
Joined on 11-22-2005
MN, USA
Posts 141
08-23-2007 1:20 PM
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.

swirlingmass

Loading...
Joined on 05-02-2007
Posts 384
08-26-2007 2:43 PM
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 

mangesh.v.s

Loading...
Joined on 08-22-2007
Posts 6
08-29-2007 6:13 PM
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.

jasonxz

Loading...
Joined on 04-17-2007
Arlington, TX
Posts 522
08-30-2007 2:17 AM
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

 

mangesh.v.s

Loading...
Joined on 08-22-2007
Posts 6
08-19-2008 7:42 AM
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. 

nirav123

Loading...
Joined on 08-14-2008
Posts 5
Microsoft Communities