My problem is simple. From an aspx page, I need to open in a new window a document stored in Sharepoint. To access the document in SharePoint I need to provide credentials. To open the document in a new window, I need to use javascript. => how to link the two ? here is the code :
ClientContext ctx = new ClientContext(strServerUrl);
Web currentWeb = ctx.Web;
ctx.Load(currentWeb);
ctx.Credentials = new System.Net.NetworkCredential("Login", "Password", "Domain");
ctx.ExecuteQuery();
// Here I have access to SharePoint.
// I can download the document, but I just want to display it in a new window
// something is missing here
string strScript;
strScript = "window.open('" + myUrltotheDocument + "','','width=800,height=800,resizable=yes,scrollbars=yes');";
ScriptManager.RegisterStartupScript(myPanel, myPanel.GetType(), "ShowInfo", strScript, true);
Thank you for your help.