asp.net wap 2.0 实现 ishtml32 下 加载 css文件
使用asp.net 开发wap 网站,在ishtml32下,如果手机浏览器支持ishtml32,但是 SupportsCss=False 时,想加载css文件时,采用重写mobile:form的方法来实现
using System;
using System.Configuration;
using System.Web.UI.MobileControls;
using System.Web.UI.MobileControls.Adapters;
public class MyForm : Form
{
public string CssPath
{
get
{
if( ViewState["CssPath"] != null)
return (string)ViewState["CssPath"];
else
return string.Empty;
}
set
{
ViewState["CssPath"] = value;
}
}
}
//Now Create the Form Adapter
public class HtmlMyFormAdapter : HtmlFormAdapter
{
protected new MyForm Control
{
get
{
return (MyForm)base.Control;
}
}
protected override bool RenderExtraHeadElements( HtmlMobileTextWriter writer )
{
if( writer != null )
{
if( this.Control.CssPath.Length > 0 )
&n
相关文档:
IE6下链接伪类(:hover)CSS背景图片有闪动BUG,主要原因ie会再一次请求这张图片,或者说图片没被缓存。
例如:
CSS代码
a:hover{background:url(imagepath)}
常用的解决方案:
在页面底部添加以下IE6专用代码,让IE6缓存CSS背景图片至本地,这样a:hover时IE6就不会再重新向服务器请求加载背景图片了。
......
地震 网站变成灰黑色 css 代码
5.19-5.21为全国哀悼日, 百度、网易、新浪等各大网站均变成了灰黑色网页。怎样使网页变成灰黑色呢?
国务院决定5月19日至21日为全国哀悼日为方便站点哀悼,特提供css滤镜代码,以表哀悼。以下为全站CSS代码。
html {...}{ filter:progid:DXImageTransform.Microsoft.BasicImage(g ......
预读内容对于部分网速慢,或者加载内容过多的页面,是非常有效的提高友好程度的方法。防止出现由于样式表,和关键图片加载滞后,导致的页面布局错乱,以及关键图片不能马上展示。
也可以防止由于页面信息加载不全,导致js出错。
经过一番尝试,此方法可以兼容IE及其他浏览器。
在IE下 用 new Image().src
的形式进行 ......
//default.aspx.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Runtime.InteropService ......