页面使用技巧汇总(1)

(1)服务器代码刷新父页上的某个控件:

private void UpdateLeftTree()
        {
            Response.Write("");
        }

(2)测试远程文件是否存在:

private bool Test(string fileUrl)
{
    try
    {
        HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(fileUrl));
        httpWebRequest.Method = "HEAD";
        httpWebRequest.Timeout = 1000;
        return (((HttpWebResponse)httpWebRequest.GetResponse()).StatusCode == HttpStatusCode.OK);
    }
    catch
    {
        return false;
    }
}

(3)IFRAME控制自身全屏:

function show()
{
var frm=parent.document.getElementById("frame");
var head=parent.document.getElementById("head");
var bottom=parent.document.getElementById("bottom"); 
if(head.style.display=="none")
{
head.style.display="block";
bottom.style.display="block";
frm.style.left= "0px ";
frm.style.top= "0px ";

frm.style.position="relative";//style="display :none"

}
else
{
head.style.display="none";
bottom.style.display="none";
frm.height ="100%";
frm.style.position= "absolute";
frm.style.left= "0px ";
frm.style.top= "0px ";

}
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值