Hi there,
I have a some code to open a speicific path in a new window
Now what i want is to write the filecontent to a window and add the bookmark.Code:DbUtils.StartTransaction(); VwPersonExerciseIDResultRecord rec = VwPersonExerciseIDResultView.GetRecord("ID=" + this.ID1.Text); string filename = rec.FileName; byte[] contents = rec.FileContent; // Store the contents of attachment temporarily in a file. // Delete the temporary file if it exists already. // Save to physicalPath string physicalPath = this.Page.Request.PhysicalApplicationPath + @"MyResults\" + filename; if (System.IO.File.Exists(physicalPath)) { System.IO.File.Delete(physicalPath); } // Create the temporary file and store contents. System.IO.FileStream fs; fs = new System.IO.FileStream(physicalPath, System.IO.FileMode.CreateNew); System.IO.BinaryWriter bw; bw = new System.IO.BinaryWriter(fs); bw.Write(contents); bw.Flush(); bw.Close(); fs.Close(); string filepath = this.Page.Request.Url.OriginalString; filepath = filepath.Replace("Result.aspx", filename); filepath += "#" + rec.Bookmark; ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "openPolicy", @"window.open('" + filepath + "','Policy')", true);
Many thanks for any suggestion,
Figa




Reply With Quote