Dimitris Sapikas
Dimitris Sapikas

Reputation: 622

xml in windows phone with linq

i am having this server side code :

<?php
header('Content-Type: text/xml');
?>
<?xml version="1.0" encoding="utf-8" ?>
<Data>
<Entry> <?php echo time(); ?> </Entry>
</Data>

and this on a windows phone application :

Imports System.Xml.Linq
Partial Public Class MainPage
    Inherits PhoneApplicationPage
    Public Sub New()
        InitializeComponent()
    End Sub
    Private Sub cl_DownloadStringCompleted(sender As Object, e As System.Net.DownloadStringCompletedEventArgs)
        Dim doc = XDocument.Parse(e.Result)
        TextBox1.Text = doc.<Data>.<Entry>.Value
    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
        Dim cl As New WebClient
        AddHandler cl.DownloadStringCompleted, AddressOf cl_DownloadStringCompleted
        cl.DownloadStringAsync(New Uri("http://localhost/wp/helloworld.php"))
    End Sub
End Class

but here is my problem : it does not change the values ! it show the same thing all the time ! it must be somthing like cached memory ... (?)

any ideas ?

Upvotes: 0

Views: 135

Answers (1)

Anton Sizikov
Anton Sizikov

Reputation: 9240

Try to add some fake data to your request:

cl.DownloadStringAsync(New Uri("http://localhost/wp/helloworld.php?" + "fake="+DateTime.Now.Ticks));

This is a way to cheat the caching system of the OS.

And you don't need to pars the fake paramater on the serverside.

Upvotes: 1

Related Questions