Hi,
i'm a beginner web programmer. I've been coding desktop applications primarily. Right now, i have created this web app, in Silverlight, that uses a web service of my own for querying the database. The thing is, one of the app functionalities is the ability to open PDF files. I know that silverlight won't let you do this, but using an IFrame on top of the silverlight application you are able to display a page with de pdf file (using acrobat plug in). So here's the problem, my silverlight app passes the pdf path to the web service and, in return, the web service would create a new Page and pass the new page URI back so that it can be displayed on the IFrame:
Page Code Behing:
public partial class PDFViewer : System.Web.UI.Page
{
string Filename = string.Empty;
public Uri Uri
{
get { return HttpContext.Current.Request.Url; }
}
public PDFViewer(string filename)
{
Filename = filename;
}
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "Application/pdf";
Response.WriteFile(Filename); //Write the file directly to the HTTP content output stream.
Response.End();
}
}
WebMethod Code:
[WebMethod]
public string GetReport(string filename)
{
PDFViewer viewer = new PDFViewer(filename);
return viewer.Uri.AbsoluteUri;
}
this only returns the Web service URL. So the main question is: How to create a page instance and obtain that page URL?
The solution to this might be here: http://forums.silverlight.net/forums/p/76977/372282.aspx
"In my Silverlight app i open a new web browser by passing in query string my id and the page process it, query the db, retrieve the selected object and renders with the response methods."
I just don't know how to do it.
Any help is greatly appreciated.
Pedro