Click here to Skip to main content
15,922,894 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: HttpWebRequest in Silverlight Application Pin
Thi**013-Dec-09 1:29
Thi**013-Dec-09 1:29 
GeneralRE: Re: HttpWebRequest in Silverlight Application [Solved] Pin
Thi**013-Dec-09 6:53
Thi**013-Dec-09 6:53 
The tip with the WebClient worked for me. Big Grin | :-D

I will explain what the point was.

You have to know this:
http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx[^]

What this text says is, that the Silverlight-Runtime looks first for a certain security-file when a resource is called from a server: the clientaccesspolicy.xml. When this file is not correct or not there at all then a security exception is thrown.

The problem was:
This file was not there so i had to put i manually on my localhost.
(I have apache. The clientaccesspolicy.xml has to be put in the htdocs folder.)
clientaccesspolicy.xml :
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from>      
        <domain uri="*"/>
      </allow-from>      
      <grant-to>      
        <resource path="/" include-subpaths="true"/>
      </grant-to>      
    </policy>
  </cross-domain-access>
</access-policy>


This is my Silverlight App :
public void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
                Debug.WriteLine(e.Result);
        }

        public void XmlReadTest()
        {
            Uri url = new Uri("http://localhost/stage2.xml",UriKind.Absolute);
            WebClient client = new WebClient();
            client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
            client.DownloadStringAsync(url);
          
        }


Nice Closing Time
QuestionExecutes a delegate on the thread that owns the control's underlying window handle Pin
cppwxwidgetsss2-Dec-09 2:41
cppwxwidgetsss2-Dec-09 2:41 
AnswerRe: Executes a delegate on the thread that owns the control's underlying window handle Pin
Ian Shlasko2-Dec-09 5:06
Ian Shlasko2-Dec-09 5:06 
GeneralRe: Executes a delegate on the thread that owns the control's underlying window handle Pin
cppwxwidgetsss2-Dec-09 18:23
cppwxwidgetsss2-Dec-09 18:23 
QuestionMenuItem like the Sort menuitem in Firefox 3's Organize Bookmarks ... ? Pin
Mohammad Dayyan1-Dec-09 23:01
Mohammad Dayyan1-Dec-09 23:01 
AnswerRe: MenuItem like the Sort menuitem in Firefox 3's Organize Bookmarks ... ? Pin
Ashfield2-Dec-09 1:32
Ashfield2-Dec-09 1:32 
QuestionShould I use Silverlight Pin
Mycroft Holmes1-Dec-09 19:26
professionalMycroft Holmes1-Dec-09 19:26 
AnswerRe: Should I use Silverlight Pin
Mark Salsbery2-Dec-09 8:28
Mark Salsbery2-Dec-09 8:28 
GeneralRe: Should I use Silverlight Pin
Mycroft Holmes2-Dec-09 12:05
professionalMycroft Holmes2-Dec-09 12:05 
QuestionWPF Data Grid Auto Height problem Pin
wasimsharp30-Nov-09 21:44
wasimsharp30-Nov-09 21:44 
AnswerRe: WPF Data Grid Auto Height problem Pin
Super Lloyd2-Dec-09 14:43
Super Lloyd2-Dec-09 14:43 
Question[Message Deleted] Pin
noufal200930-Nov-09 21:05
noufal200930-Nov-09 21:05 
AnswerRe: textbox validation in silverlight Pin
Abhinav S30-Nov-09 21:57
Abhinav S30-Nov-09 21:57 
GeneralRe: textbox validation in silverlight Pin
noufal200930-Nov-09 23:08
noufal200930-Nov-09 23:08 
AnswerRe: textbox validation in silverlight Pin
Abhinav S30-Nov-09 23:15
Abhinav S30-Nov-09 23:15 
GeneralRe: textbox validation in silverlight Pin
noufal200930-Nov-09 23:35
noufal200930-Nov-09 23:35 
AnswerRe: textbox validation in silverlight [modified] Pin
Abhinav S30-Nov-09 23:45
Abhinav S30-Nov-09 23:45 
GeneralRe: textbox validation in silverlight Pin
Mark Salsbery1-Dec-09 8:08
Mark Salsbery1-Dec-09 8:08 
AnswerRe: textbox validation in silverlight Pin
fred_1-Dec-09 4:40
fred_1-Dec-09 4:40 
QuestionValidationRule bind two values Pin
ezazazel30-Nov-09 20:25
ezazazel30-Nov-09 20:25 
AnswerRe: ValidationRule bind two values Pin
Pete O'Hanlon30-Nov-09 21:42
mvePete O'Hanlon30-Nov-09 21:42 
Questionhelp animation wpf - vb Pin
Member 360941530-Nov-09 6:55
Member 360941530-Nov-09 6:55 
AnswerRe: help animation wpf - vb Pin
Christian Graus1-Dec-09 5:32
protectorChristian Graus1-Dec-09 5:32 
QuestionWPF property xaml serialization in design time problem Pin
Thomas Duwe30-Nov-09 3:20
Thomas Duwe30-Nov-09 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.