[源码下载]


ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList


作者:webabcd


介绍
控件适配器(Control Adapters)可以让你改变通过ASP.NET控件生成的HTML标记。http://www.asp.net/cssadapters/有详细的介绍和示例,但是没有用ul、li呈现CheckBoxList和RadioButtonList的例子(可能是因为太简单了,不屑去写),那就让我们来实现它吧,顺便熟悉一下如何开发控件适配器。


示例
App_Code/ControlAdaptersSample.cs
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonListusing System;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Data;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Configuration;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Web;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Web.Security;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Web.UI;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Web.UI.WebControls;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Web.UI.WebControls.WebParts;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Web.UI.HtmlControls;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
using System.Web.UI.WebControls.Adapters;
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList

App_Browsers/ControlAdaptersSample.browser
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList<browsers>
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList  
<browser refID="Default">
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList    
<controlAdapters>
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList      
<adapter controlType="System.Web.UI.WebControls.CheckBoxList"
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList         adapterType
="ControlAdaptersSample" />
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList      
<adapter controlType="System.Web.UI.WebControls.RadioButtonList"
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList         adapterType
="ControlAdaptersSample" />
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList    
</controlAdapters>
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList  
</browser>
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList
</browsers>
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonList

都有什么browsers可用呢?可以在如下的路径中找到
ASP.NET 2.0中的友好CSS控件适配器的应用 - 用ul、li呈现CheckBoxList和RadioButtonListC:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers

ControlAdaptersSample.aspx

运行结果
CheckBoxList和RadioButtonList将以ul、li呈现


OK
[源码下载]

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-15
  • 2021-11-19
  • 2021-09-20
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案