0
私はいくつかの画面にヘルプアイコンがあるWebアプリケーションで作業しています。私がする必要があるのは、ヘルプアイコンをクリックしたときに、ヘルプドキュメントのpdfファイルが新しいタブ/ウィンドウで開き、このpdfが特定のセクションで開きます(つまり、ページ1から開くべきではありません)。これを達成するために私を助けてください。ここでI want to achieve this in new tab or window. Plz see the image新しいタブ/ウィンドウの特定のセクションでpdfを開く方法C#のコードビハインドから#
は私のコードです:
protected void registrationHelpIcon_ServerClick(object sender, EventArgs e)
{
try
{
string appBaseUrl = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + "/";
string pdfPath = "Temp/xtLytics_security_module.pdf";
WebClient client = new WebClient();
Byte[] buffer = client.DownloadData(appBaseUrl + pdfPath);
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
}
catch(Exception ex)
{
Logger.Log(LogLevel.SystemError, ex);
}
}