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
Ïà¹ØÎĵµ£º
²»Í¬µÄä¯ÀÀÆ÷ÒªÇó²»Í¬µÄÑùʽÉùÃ÷£¬¸÷ä¯ÀÀÆ÷¼°Æä¸÷°æ±¾Óв»Í¬³Ì¶ÈµÄ CSS Ö´ÐеÄÍêÕûÐÔ¡£²ÉÓõÄÊÇ Internet Explorer µÄÌõ¼þ×¢ÊÍÓï·¨µÄ˼Ï룬²¢°ÑËüÄÚÁªµ½ CSS ÉùÃ÷Ö®ÖС£
¡¡¡¡Ìõ¼þ CSS Ö÷ÒªÓÃÓÚÖ¸³öÒ»¸öÌØ±ðµÄ CSS ÉùÃ÷ÊDz»ÊÇÓ¦¸ÃÓÃÓÚÒ»¸öÌØ±ðµÄä¯ÀÀÆ÷¡£µ±È»Ä㲻ϣÍû¾³£Õâô×ö£¬µ«Êǵ±ÄãÐèÒªÕë¶ÔÒ»¸öä¯ÀÀÆ÷µÄʱºò£¬Ëü»á·Ç³ ......
<form action="" method="post">
<table border="1">
<tr>
<td width="40">Óû§Ãû</td>
<td> <input name="username" size="5" maxlength="8" /> </td>
</tr>
<tr>
<td width="40">ÃÜÂë</td&g ......
//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 ......
¹ØÓÚClientIDµÄʹÓÃÎÒÓöµ½Ò»ÏÂÎÊÌ⣺
»ñÈ¡ÓÉ ASP.NET Éú³ÉµÄ·þÎñÆ÷¿Ø¼þ±êʶ·û¡£
ÎÊÌâÒ»£º Óû§¿Ø¼þµÄÒ³ÃæJavaScriptÖÐÐèҪʹÓÃAsp.netµÄ¿Ø¼þID£¬³öÏÖ²»Ò»Ö¡£
ÎÊÌâ¶þ£ºÄ¸°æÒ³µÄ×ÓÒ³ÃæJavaScriptÖÐÐèҪʹÓÃAsp.netµÄ¿Ø¼þID£¬³öÏÖ²»Ò»Ö¡£
½â¾ö°ì·¨£º
document.getElementById("<% ......