I have a file hosted in a secured site (https), so I use the web browser control to pass the URL and the headers for authentication. Can the WebBrowser control render the document/pdf files just like the phone native browser. Even the public document(not secure) are not rendering. Does the webbrowser control similar to the native phone IE when it comes to file download?
If you just want to open a PDF from a web location you'll have to do:
new WebBrowserTask
{
Uri = new Uri("http://path.to/file.pdf", UriKind.Absolute)
}.Show();
This depends on the user having the Adobe, PDF viewer app installed on their phone. There's no way to show a PDF document within the WebBrowser control.
Related
when url like youtube.com or others are set, it opens in webBrowser but when pdf link is kept nothing happens, why is that??
WebBrowser pdfview = new WebBrowser();
pdfview.setURL("http://www.codenameone.com/files/developer-guide.pdf");
//this link downloads the pdf file in browser but does nothing in codename one browser...
f.addComponent(pdfview);
i jst want to view this pdf from the browser
Opening a PDF in the browser component will only work on devices and won't work in the simulator.
I want to download a image from any URL through silverlight webpart in Sharepoint 2010.
I am able to download image from the same site, but not from other ones (within the same server itself).
I am using WebClient class and opening the image file asynchronously.
Please suggest some ways to achieve this.
I want download file from server. I know how to do this using WCF/RIA services. How can I do this like in web site. For example: I click button and It will appear standard dialog browser window to download file.
Use the Hyperlink control and link it to a server-side URL. This is what I've done in my app to avoid the whole generic save file prompt restrictions of the default SL sandbox.
In my silverlight application I want to open a xaml in a new web browser. how can I do that?
with HTMLPage.Window.Navigate it is just aspx pages - maybe I can convert xaml to aspx?
10x!
a XAML page cannot be shown in a browser window. What Silverlight do actually is showing the Silverlight program within an < object > tag in the aspx (or html) page; nothing more.
In your silverlight project, if you chose to host your project in a new web site, you will see a second project with both a htm and aspx file that hosts that object that links to your xap file.
So basically, you need to create a second Silverlight project that will be hosted in a different aspx page. Then in your main silverlight project your can open that new aspx page in a new web browser window.
Is it possible to load in an image from another domain using JavaScript, and then pass the image to a Silverlight control on my page?
The only workaround I'm familiar with for this, since it's a security issue, is to set up a web service on a server you have control over, request the image from this web service from your Silverlight application, then have the service grab the image from the other server and return it to the client.
Loading cross-domain images should not be an issue in Silverlight, at least if you are using the normal Image control. I just tested this with a really simple application containing only an Image control with the Source property set to an image from google images.
Are you loading your images in some funky way with the WebClient? Cross-scheme and cross-zone access is restricted for the Image class, so you would not be able to load an image (on any domain) over SSL if you loaded your XAP over regular HTTP.
The MSDN page on Silverlight URL Access Restrictions gives you a good overview of what you can and cannot do with Image, MediaElement, WebClient, and streaming video.