asp.net iframe控件 [英] asp.net iframe control

查看:79
本文介绍了asp.net iframe控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< iframe id =pdfiframerunat =serverheight =400pxwidth =800px>< / iframe>



pdfiframe .Attributes.Add(src,urlpath);



它的工作正常,即显示图像但不能在chrome中运行anf firefox plz帮帮我

解决方案





而不是显示 iframe PDF文件(我假设您要显示PDF文件,因为 iframe 的I​​D是pdfiframe),您也可以使用PDF.JS来呈现PDF文件:

http://mozilla.github.io/pdf.js/ [< a href =http://mozilla.github.io/pdf.js/target =_ blanktitle =New Window> ^ ]


Don'认为这是最好的方法,但是,它会很好用。如果你专注于Pdf文件,请使用另一个答案。

  string  s =  < SCRIPT LANGUAGE = \JavaScript \> document.getElementById('pdfiframe')。src = {0}; < SCRIPT>中; 
System.Web.HttpContext.Current.Response.Write( string .Format(s,urlpath));


<iframe id="pdfiframe" runat="server" height="400px" width="800px"></iframe>

pdfiframe.Attributes.Add("src", urlpath);

its working fine in ie showing image but not working in chrome anf firefox plz help me out

解决方案

Hi,

Instead of an iframe to show a PDF file (I assume that you want to show a PDF file because the ID of the iframe is "pdfiframe"), you can also use PDF.JS to render PDF files:
http://mozilla.github.io/pdf.js/[^]


Don't consider this the best approach, but, it will work nice. If you are focusing on Pdf files, use the other answer.

string s = "<SCRIPT LANGUAGE=\"JavaScript\">document.getElementById('pdfiframe').src = {0};<SCRIPT>";
System.Web.HttpContext.Current.Response.Write(string.Format(s, urlpath));


这篇关于asp.net iframe控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆