只有Safari ,当点击按钮rad窗口打开,我试图关闭窗口,但只是关闭rad窗口的顶部栏但stil身体仍然是.i假设它发生的原因Response.WriteFile(); 请提出一些好的解决方案。
protected void btnReset_Click(object sender, EventArgs e)
{
radwindow.NavigateUrl="DisplayImage.aspx?physicalPathToFile="docpath;
radwindow.VisibleOnPageLoad = true;
}
请考虑以下代码
<telerik:RadWindow ID="radwindow" runat="server" VisibleOnPageLoad="false" Width="1000px" Height="1000px"
Title="Open Document" Modal="true" BackColor="#DADADA" VisibleStatusbar="false" Behaviors="Close,Move,Minimize,Maximize">
UserProfile.aspx.cs
string physicalPathToFile=Request["physicalPathToFile"];
//For pdf document --application/pdf
if (Path.GetExtension(physicalPathToFile).Equals(".pdf", StringComparison.CurrentCultureIgnoreCase))
{
WriteFile(physicalPathToFile, "application/pdf", Context.Response);
}
private void WriteFile(string physicalPathToFile, string contentType, HttpResponse response)
{
try
{
response.Buffer = true;
response.Clear();
response.ContentType = contentType == "" ? response.ContentType : contentType;
response.WriteFile(physicalPathToFile);
response.Flush();
response.End();
}
catch (Exception ex)
{
throw ex;
}
}