This commit is contained in:
2025-03-03 10:53:04 +08:00
parent ac3e368d1f
commit 4d9b7e2b79
5 changed files with 54 additions and 10 deletions
+7 -5
View File
@@ -10,17 +10,19 @@
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="TabStrip1" runat="server" />
<f:TabStrip ID="TabStrip1" IsFluid="true" ShowBorder="true" ActiveTabIndex="0"
<f:TabStrip ID="TabStrip1" IsFluid="true" ShowBorder="true" ActiveTabIndex="0" Hidden="true"
runat="server">
<Tabs>
<f:Tab ID="Tab1" EnableIFrame="true"
<Tabs>
<f:Tab ID="Tab1" EnableIFrame="true" Width="12000px"
Title="预览" runat="server">
</f:Tab>
</Tabs>
</f:TabStrip>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" hidden="true" Text="关闭" runat="server" Icon="SystemClose" Size="Medium">
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" Hidden="true" Text="关闭" runat="server" Icon="SystemClose" Size="Medium">
</f:Button>
<iframe id="LookHtml" runat="server" width="700" height="600" name="LookHtml" hidden="hidden"></iframe>
<iframe id="LookHtml" runat="server" width="700" height="600" name="LookHtml" hidden="hidden"></iframe>
<f:Image ID="Image1" runat="server" ImageMinWidth="1000px" Icon="World" Hidden="true">
</f:Image>
</form>
</body>
</html>
+14 -4
View File
@@ -22,7 +22,7 @@ namespace FineUIPro.Web.AttachFile
{
newurl = Baseurl + Fileurl;
}
else if (FiletExtension == ".txt"|| FiletExtension== "pdf")
else if (FiletExtension == ".txt" || FiletExtension == "pdf")
{
newurl = Fileurl;
}
@@ -30,9 +30,19 @@ namespace FineUIPro.Web.AttachFile
{
newurl = Fileurl;
}
this.LookHtml.Src = newurl;
this.Tab1.IFrameUrl = newurl;
if (AttachFileService.IsImage(FiletExtension))
{
this.TabStrip1.Hidden = true;
this.Image1.Hidden = false;
this.Image1.ImageUrl = newurl;
}
else
{
this.TabStrip1.Hidden = false;
this.Image1.Hidden = true;
this.LookHtml.Src = newurl;
this.Tab1.IFrameUrl = newurl;
}
//StreamReader fread = new StreamReader(url, System.Text.Encoding.GetEncoding("gb2312"));
//string ss = fread.ReadToEnd();
//Response.Write(ss);
+9
View File
@@ -67,5 +67,14 @@ namespace FineUIPro.Web.AttachFile
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlIframe LookHtml;
/// <summary>
/// Image1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Image Image1;
}
}