<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Log4D &#187; Microsoft .Net</title>
	<atom:link href="http://dddspace.com/category/iprogramer_/dotnet_/feed" rel="self" type="application/rss+xml" />
	<link>http://dddspace.com</link>
	<description>IT Makes Better Life</description>
	<lastBuildDate>Fri, 03 Sep 2010 14:19:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>获取每日Bing图片</title>
		<link>http://dddspace.com/2010/07/get-daily-bing-picture.html</link>
		<comments>http://dddspace.com/2010/07/get-daily-bing-picture.html#comments</comments>
		<pubDate>Mon, 19 Jul 2010 11:06:18 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[Python编程]]></category>
		<category><![CDATA[Bing]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12904</guid>
		<description><![CDATA[在使用公司一个Redirect开发工具页面时候，想个性化一下，就想添加一个背景，最好每天能自动变化，我第一个想到的就是Bing。

放狗搜索，发现一篇文章 抓取每天必应bing背景图片 &#8211; huangct的专栏 &#8211; CSDN博客，文中提供了抓取程式的Python代码，我摘录如下。

import urllib

<span class="readmore"><a href="http://dddspace.com/2010/07/get-daily-bing-picture.html" title="获取每日Bing图片">阅读全文——共2253字</a></span>]]></description>
			<content:encoded><![CDATA[<p>在使用公司一个Redirect开发工具页面时候，想个性化一下，就想添加一个背景，最好每天能自动变化，我第一个想到的就是Bing。</p>
<p>放狗搜索，发现一篇文章 <a href="http://blog.csdn.net/huangct/archive/2009/10/27/4734844.aspx">抓取每天必应bing背景图片 &#8211; huangct的专栏 &#8211; CSDN博客</a>，文中提供了抓取程式的Python代码，我摘录如下。</p>
<pre class="brush: python;fontsize: 100; first-line: 1; ">import urllib
import time
def main():
    url = &#39;http://www.bing.com&#39;
    f = urllib.urlopen(url)
    html = f.read()
    f.close()
    a = html[html.index(&#39;\/fd\/hpk2&#39;):]
    data = a[:a.index(&#39;\&#39;,id:&#39;)]
    url = data.replace(&#39;\\&#39;, &#39;&#39;)
    url = &#39;http://www.bing.com&#39;+url
    name=time.strftime(&quot;%Y%m%d&quot;, time.localtime())
    name=name+&quot;.jpg&quot;
    urllib.urlretrieve(url,name)

if __name__ == &quot;__main__&quot;:
    main()</pre>
<p>关键的步骤是MS修改了jpg的url方式，用<span style="color: rgb(255, 0, 0);">g_img={url:&#39;\/fd\/hpk2\/BambooBoat_ZH-CN1057817945.jpg&#39;</span>这样的字符串躲避机器人的抓取。简单的替换即可完成。<span id="more-12904"></span></p>
<p>我用C#重写了代码实现，如下所示。</p>
<pre class="brush: csharp;fontsize: 100; first-line: 1; ">using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace com.dddspace.GetBingImg
{
    #region 获取Bing图片
    class GetBingImg
    {
        static void Main(string[] args)
        {
            try
            {
                string html = GetHtml(&quot;http://www.bing.com&quot;);
                html = html.Substring(html.IndexOf(@&quot;\/fd\/hpk2\/&quot;));
                html = html.Substring(0, html.IndexOf(&quot;.jpg&quot;) + 4);
                html = html.Replace(&quot;\\&quot;, &quot;&quot;);
                string url = &quot;http://www.bing.com&quot; + html;
                Console.WriteLine(url);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }

        public static string GetBingImg()
        {
            string html = GetHtml(&quot;http://www.bing.com&quot;);
            html = html.Substring(html.IndexOf(@&quot;\/fd\/hpk2\/&quot;));
            html = html.Substring(0, html.IndexOf(&quot;.jpg&quot;) + 4);
            html = html.Replace(&quot;\\&quot;, &quot;&quot;);
            return &quot;http://www.bing.com&quot; + html;
        }

        /// &lt;summary&gt;
        /// 获得页面的html代码
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;url&quot;&gt;页面地址&lt;/param&gt;
        protected static string GetHtml(string url)
        {
            string html = &quot;&quot;;
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            request.Accept = &quot;*/*&quot;;
            HttpWebResponse response = null;
            Stream stream = null;
            StreamReader reader = null;
            try
            {
                response = (HttpWebResponse)request.GetResponse();
                stream = response.GetResponseStream();
                reader = new StreamReader(stream, Encoding.UTF8);
                html = reader.ReadToEnd().Replace(&quot;\r\n&quot;, &quot;&quot;);   //我知道这里会改变html代码，但和这里没关系
            }/*
            catch (Exception excpt)
            {
                Console.WriteLine(excpt);
                Console.Write(&quot;\n【注意】出现异常，输入任意字符和回车继续：&quot;);
                Console.ReadLine();
            }*/
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                    reader.Dispose();
                }
                if (stream != null)
                {
                    stream.Close();
                    stream.Dispose();
                }
                if (response != null)
                {
                    response.Close();
                }
            }
            return html;
        }
    }
    #endregion
}
</pre>
<p>没多大的技术含量，就是用来把玩把玩。</p>
<p>在.aspx中加一个Panel，然后使用<code>this.Panel1.BackImageUrl = BingImg.GetBingImg();</code>设置一下背景图片就万事OK了。现在，一个死板的小工具就稍微变得丰富多彩一些，是不是会让你工作的情绪略微提高呢~</p>
<p>附上今天的Bing图片</p>
<p><a href="http://cn.bing.com/fd/hpk2/Finca_ZH-CN2784763289.jpg" class="highslide-image" onclick="return hs.expand(this);"><img alt="" height="321" src="http://cn.bing.com/fd/hpk2/Finca_ZH-CN2784763289.jpg" width="600" /></a></p>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2010/07/get-daily-bing-picture.html">http://dddspace.com/2010/07/get-daily-bing-picture.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">你也许会喜欢下面的文章</div><ul class="related_post"><li><a href="http://dddspace.com/2008/11/recently-kazakhstan.html" title="最近哈">最近哈</a></li><li><a href="http://dddspace.com/2010/03/about-google.html" title="关于Google">关于Google</a></li><li><a href="http://dddspace.com/2009/05/ubuntu8-10-under-the-mysql-installation.html" title="Ubuntu8.10下MySQL的安装">Ubuntu8.10下MySQL的安装</a></li><li><a href="http://dddspace.com/2009/08/jie-jue-windows-server-2003-bu-ren-u-pan-huo-yi-dong-ying-pan.html" title="解决windows server 2003不认U盘或移动硬盘">解决windows server 2003不认U盘或移动硬盘</a></li><li><a href="http://dddspace.com/2009/08/allergic-in-mind.html" title="过敏记">过敏记</a></li><li><a href="http://dddspace.com/2009/05/landscaping-postviews.html" title="美化postviews">美化postviews</a></li><li><a href="http://dddspace.com/2009/07/network-in-shanghai-to-learn-english.html" title="开始在沪江网学英语">开始在沪江网学英语</a></li><li><a href="http://dddspace.com/2009/05/station-restoration-of-mind.html" title="小站恢复记">小站恢复记</a></li><li><a href="http://dddspace.com/2009/06/xom-class-library-to-use-java-objects-serialization.html" title="使用XOM类库对Java对象进行序列化">使用XOM类库对Java对象进行序列化</a></li><li><a href="http://dddspace.com/2009/06/google-doors.html" title="Google门">Google门</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2010/07/get-daily-bing-picture.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>PDA&#8221;未能建立与网络的连接&#8221;的解决办法</title>
		<link>http://dddspace.com/2010/03/solution-of-pda-failed-to-establish-a-network-connection.html</link>
		<comments>http://dddspace.com/2010/03/solution-of-pda-failed-to-establish-a-network-connection.html#comments</comments>
		<pubDate>Wed, 31 Mar 2010 01:00:33 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[移动编程和手机应用开发]]></category>
		<category><![CDATA[PDA]]></category>
		<category><![CDATA[VisualStudio]]></category>
		<category><![CDATA[WinCE]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12874</guid>
		<description><![CDATA[遇到这个问题大凡是因为模拟器或者真机无法连接网络，所以需要先测试网络是否畅通，在真机或者模拟器的IE中打开需要的WebService地址，看看是否能够正常获取。

确定是网络原因后，可以采用多种方式连接网络，比如使用虚拟网卡来实现，又或者使用ActiveSync来实现。

使用本地网卡

<span class="readmore"><a href="http://dddspace.com/2010/03/solution-of-pda-failed-to-establish-a-network-connection.html" title="PDA&#8221;未能建立与网络的连接&#8221;的解决办法">阅读全文——共713字</a></span>]]></description>
			<content:encoded><![CDATA[<p>遇到这个问题大凡是因为模拟器或者真机无法连接网络，所以需要先测试网络是否畅通，在真机或者模拟器的IE中打开需要的WebService地址，看看是否能够正常获取。</p>
<p>确定是网络原因后，可以采用多种方式连接网络，比如使用虚拟网卡来实现，又或者使用ActiveSync来实现。</p>
<h3>使用本地网卡</h3>
<p>在模拟器的文件-配置中的网卡中，选择本地网卡，可能会需要提示安装Virtual PC 2007，我不愿意装这么一个大家伙，也就没有尝试这种方法，需要的朋友可以在<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=04d26402-3199-48a3-afa2-2dc0b40a73b6&amp;DisplayLang=en">Download details: Virtual PC 2007</a>来下载Virtual PC 2007进而连接互联网。<span id="more-12874"></span></p>
<h3>使用ActiveSync</h3>
<p>ActiveSync是一个连接Win系列手持到电脑的同步软件，通过它可以使真机或者模拟机连接网络，步骤如下。</p>
<p>1、打开ActiveSync ，点击文件-连接设置，在&ldquo;允许连接到以下其中一个端口&rdquo;下选择&ldquo;DMA&rdquo;。</p>
<p>2、打开 VS2005，点击菜单工具-设备仿真管理器，选择一个windows mobile 5.0 PocketPC 模拟器。在右键菜单中点击&ldquo;连接&rdquo;。等模拟器启动后，再点击&ldquo;插入底座&rdquo;，此时，通过ActiveSync来连接到模拟器，并进行数据同步。</p>
<p>3、测试一下能不能连上网络，比如说Baidu（现在G.cn已经不能作为能否上网的标志了）或者WebService地址。</p>
<h3>参考连接</h3>
<p><a href="http://www.chinaret.com/user/topic_view.aspx?u=jianfangkk&amp;id=0b10f862-db59-4a52-9ceb-9ef1023acd9a">PDA智能程序访问WebService，报告&ldquo;未能建立与网络的连接&rdquo;?<br />
	</a></p>
<p><a href="http://topic.csdn.net/u/20080610/18/da506852-57da-4df0-beb4-6952eece2f4e.html">请问PDA智能程序访问WebService，报告&ldquo;未能建立与网络的连接&rdquo;?<br />
	</a></p>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2010/03/solution-of-pda-failed-to-establish-a-network-connection.html">http://dddspace.com/2010/03/solution-of-pda-failed-to-establish-a-network-connection.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2010/03/a-solution-of-can-not-create-or-open-the-smart-device-project-in-vs2005.html" title="VS2005无法创建或打开&#8221;智能设备&#8221;项目的一个问题的解决方法">VS2005无法创建或打开&#8221;智能设备&#8221;项目的一个问题的解决方法</a></li><li><a href="http://dddspace.com/2010/09/vs-vim.html" title="将VisualStudio打造成Vim">将VisualStudio打造成Vim</a></li><li><a href="http://dddspace.com/2009/07/aspx-code-vs2008-format.html" title="VS2008格式化aspx代码">VS2008格式化aspx代码</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2010/03/solution-of-pda-failed-to-establish-a-network-connection.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VS2005无法创建或打开&#8221;智能设备&#8221;项目的一个问题的解决方法</title>
		<link>http://dddspace.com/2010/03/a-solution-of-can-not-create-or-open-the-smart-device-project-in-vs2005.html</link>
		<comments>http://dddspace.com/2010/03/a-solution-of-can-not-create-or-open-the-smart-device-project-in-vs2005.html#comments</comments>
		<pubDate>Mon, 29 Mar 2010 03:11:55 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[移动编程和手机应用开发]]></category>
		<category><![CDATA[VisualStudio]]></category>
		<category><![CDATA[WinCE]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12872</guid>
		<description><![CDATA[状况

在VS2005中创建或打开&#8220;智能设备&#8221;项目时，提示以下错误： &#8220;从用户数据存储中检索信息时出错。系统未找到指定的对象。&#8221; 和 &#8220;由于数据存储中不存在项目引用的设备平台，因此无法打开项目。&#8221;

在打开VS2005的&#8221;工具&#8220;－&#8221;设备仿真器管理器&#8220;时，提示以下错误： &#8221;未能正确加载包&#8220;Smart Device Configuration Package&#8221;( GUID = {D245F354-3F45-4516-B1E6-04608DA126CC} )。请与包供应商联系以获得帮助。由于可能会发生环境损坏，建议重新启动应用程序。要禁止将来加载此包吗? 可以使用&#8220;devenv /resetskippkgs&#8221;重新启用包加载。&#8220;

<span class="readmore"><a href="http://dddspace.com/2010/03/a-solution-of-can-not-create-or-open-the-smart-device-project-in-vs2005.html" title="VS2005无法创建或打开&#8221;智能设备&#8221;项目的一个问题的解决方法">阅读全文——共978字</a></span>]]></description>
			<content:encoded><![CDATA[<h3>状况</h3>
<p>在VS2005中创建或打开&ldquo;智能设备&rdquo;项目时，提示以下错误： &ldquo;<span style="color: rgb(255, 0, 0);">从用户数据存储中检索信息时出错。系统未找到指定的对象。</span>&rdquo; 和 &ldquo;<span style="color: rgb(255, 0, 0);">由于数据存储中不存在项目引用的设备平台，因此无法打开项目。</span>&rdquo;</p>
<p>在打开VS2005的&rdquo;工具&ldquo;－&rdquo;设备仿真器管理器&ldquo;时，提示以下错误： &rdquo;未能正确加载包&ldquo;Smart Device Configuration Package&rdquo;( GUID = {D245F354-3F45-4516-B1E6-04608DA126CC} )。请与包供应商联系以获得帮助。由于可能会发生环境损坏，建议重新启动应用程序。要禁止将来加载此包吗? 可以使用&ldquo;devenv /resetskippkgs&rdquo;重新启用包加载。&ldquo;<span id="more-12872"></span></p>
<h3>不成功的解决办法</h3>
<p>有说把.csproj文件中的<code>&lt;PlatformID&gt;4118C335-430C-497f-BE48-11C3316B135E&lt;/PlatformID&gt;</code>改成<code>&lt;PlatformID&gt;3C41C503-53EF-4c2a-8DD4-A8217CAD115E&lt;/PlatformID&gt;</code>，原因说是&ldquo;3C41C503-53EF-4c2a-8DD4-A8217CAD115E&rdquo;来自任意一个能运行的.net cf2.0项目的.csproj文件，目标平台是ppc2003或wm5.0都可以&rdquo;，但是很可惜，这个办法在我电脑上没有起作用。</p>
<h3>成功的解决方法</h3>
<p>1. 关闭VS2005。<br />
	2. 重命名文件夹<code>c:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Microsoft\CoreCon\1.0</code>，这将删除所有关于设备配置属性的定制。<br />
	3. 重启VS2005，VS2005会自动重建上述配置。</p>
<p>原文链接：<a href="http://blog.csdn.net/bingrrx/archive/2008/07/10/2634481.aspx">VS2005 无法创建或打开&ldquo;智能设备&rdquo;项目的一个问题的解决方法 &#8211; bingrrx的专栏 &#8211; CSDN博客</a><br />
	原文的原文链接：<del>http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=140668&amp; SiteID=1</del>链接已失效</p>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2010/03/a-solution-of-can-not-create-or-open-the-smart-device-project-in-vs2005.html">http://dddspace.com/2010/03/a-solution-of-can-not-create-or-open-the-smart-device-project-in-vs2005.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2010/03/solution-of-pda-failed-to-establish-a-network-connection.html" title="PDA&#8221;未能建立与网络的连接&#8221;的解决办法">PDA&#8221;未能建立与网络的连接&#8221;的解决办法</a></li><li><a href="http://dddspace.com/2010/09/vs-vim.html" title="将VisualStudio打造成Vim">将VisualStudio打造成Vim</a></li><li><a href="http://dddspace.com/2009/07/aspx-code-vs2008-format.html" title="VS2008格式化aspx代码">VS2008格式化aspx代码</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2010/03/a-solution-of-can-not-create-or-open-the-smart-device-project-in-vs2005.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MemberShip使用心得</title>
		<link>http://dddspace.com/2009/11/membership-the-use-of-experience.html</link>
		<comments>http://dddspace.com/2009/11/membership-the-use-of-experience.html#comments</comments>
		<pubDate>Thu, 05 Nov 2009 10:08:47 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[MemberShip]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12764</guid>
		<description><![CDATA[花了很大一段时间在学习MemberShip，总是要留下一些纪念文章的。 我之前的日志提到过一个简单的用户权限设计：User+Role+UserInRole(http://dddspace.com/2009/06/design-of-user-rights.html)，但是这样还是不够灵活，最好需要能够对每一个功能模块进行权限控制，而且需要符合开闭原则。 MemberShip呢，是微软推出的一套很强大的用户权限管理系统。就我使用的两大部分，主要包括MemberShip和roleManager这两个模块，分别是对用户和角色进行管理。

<span class="readmore"><a href="http://dddspace.com/2009/11/membership-the-use-of-experience.html" title="MemberShip使用心得">阅读全文——共2486字</a></span>]]></description>
			<content:encoded><![CDATA[<p>花了很大一段时间在学习MemberShip，总是要留下一些纪念文章的。 我之前的日志提到过一个简单的用户权限设计：User+Role+UserInRole(<a href="http://dddspace.com/2009/06/design-of-user-rights.html">http://dddspace.com/2009/06/design-of-user-rights.html</a>)，但是这样还是不够灵活，最好需要能够对每一个功能模块进行权限控制，而且需要符合开闭原则。 MemberShip呢，是微软推出的一套很强大的用户权限管理系统。就我使用的两大部分，主要包括MemberShip和roleManager这两个模块，分别是对用户和角色进行管理。</p>
<h2>MemberShip对系统进行管理大致分为两个办法</h2>
<p>1.可以通过&ldquo;登录&rdquo;系列用户控件的任务窗口中的&ldquo;管理网站&rdquo;打开&ldquo;ASP.Net Web 应用程序管理&rdquo;。 可以控制用户、角色、权限三个主要属性，另外还能选择&ldquo;提供程序&rdquo;（这个provider分为MemberShip和RoleManager两种，如果同名的话，可以选择同一提供程序） <img alt="userControl" border="0" height="235" src="http://dddspace.com/wp-content/uploads/2009/11/userControl.jpg" style="border-width: 0px; display: inline;" title="userControl" width="360" /> <span id="more-12764"></span><img alt="userManager" border="0" height="291" src="http://dddspace.com/wp-content/uploads/2009/11/userManager.jpg" style="border-width: 0px; display: inline;" title="userManager" width="579" /> 2.使用Web.config进行配置 其实上面的可视化界面在配置提供程序和访问规则（权限设定）时候，本质上修改的是根目录web.config和各个文件夹下对应的web.config</p>
<p>我的根Web.config</p>
<pre class="brush: xml;fontsize: 100; first-line: 1; ">&lt;authentication mode=&quot;Forms&quot;&gt;
	&lt;forms name=&quot;ThisHouse&quot; defaultUrl=&quot;Default.aspx&quot; loginUrl=&quot;Signin.aspx&quot; protection=&quot;All&quot; timeout=&quot;30&quot;/&gt;
&lt;/authentication&gt;
&lt;membership defaultProvider=&quot;SqlProvider&quot;&gt;
	&lt;providers&gt;
		&lt;add connectionStringName=&quot;thisHouseConnectionString&quot; enablePasswordRetrieval=&quot;false&quot; enablePasswordReset=&quot;true&quot; requiresQuestionAndAnswer=&quot;true&quot; applicationName=&quot;ThisHouse&quot; requiresUniqueEmail=&quot;false&quot; passwordFormat=&quot;Clear&quot; maxInvalidPasswordAttempts=&quot;255&quot; minRequiredPasswordLength=&quot;1&quot; minRequiredNonalphanumericCharacters=&quot;1&quot; passwordAttemptWindow=&quot;10&quot; passwordStrengthRegularExpression=&quot;&quot; name=&quot;SqlProvider&quot; type=&quot;System.Web.Security.SqlMembershipProvider&quot;/&gt;
	&lt;/providers&gt;
&lt;/membership&gt;
&lt;roleManager enabled=&quot;true&quot; cacheRolesInCookie=&quot;true&quot; defaultProvider=&quot;SqlProvider&quot;&gt;
		&lt;providers&gt;
			&lt;add connectionStringName=&quot;thisHouseConnectionString&quot; applicationName=&quot;ThisHouse&quot; name=&quot;SqlProvider&quot; type=&quot;System.Web.Security.SqlRoleProvider&quot;/&gt;
		&lt;/providers&gt;
&lt;/roleManager&gt;</pre>
<p>我禁止User角色进入Admin文件夹，配置完&ldquo;访问规则&rdquo;后，会在Admin文件夹下生成相应web.config</p>
<pre class="brush: xml;fontsize: 100; first-line: 1; ">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;configuration&gt;
    &lt;system.web&gt;
        &lt;authorization&gt;
            &lt;allow roles=&quot;User&quot; /&gt;
            &lt;allow roles=&quot;Admin&quot; /&gt;
            &lt;deny users=&quot;?&quot; /&gt;
        &lt;/authorization&gt;
    &lt;/system.web&gt;
&lt;/configuration&gt;</pre>
<p>这种单纯的安全机制是以文件为单位进行配置的，不能说完美，但是有效且简单，不失为一种不错的权限控制方法。毕竟这样可以脱离在代码中的配置，而只要关注配置文件。缺点同样明显，如果想在同一个动作aspx文件中进行权限判断，就难以有效的实现，需要修改aspx代码了。</p>
<h2>MemberShip在.NET 3.5中方法的集成</h2>
<p>这个标题有点大，实际上在我的课程设计中，用到了判断是否登录、判断用户角色这两个简单的方法。</p>
<pre class="brush: csharp;fontsize: 100; first-line: 1; ">if (Page.User.Identity.IsAuthenticated)
{
	this.Login1.Visible = false;
	this.LoginStatus1.Visible = true;
	this.pEditProfile.Visible = true;
}
foreach (string role in Roles.GetRolesForUser())
{
	if (role == &quot;Admin&quot;)
	{
		this.pAdmin.Visible = true;
	}
}</pre>
<p>这段代码第一个if进行了是否登录的判断，然后foreach循环判断用户角色。 大部分方法在&ldquo;System.Web.Security.Roles&rdquo;、&ldquo;System.Web.Security.Membership&rdquo;中，可以在MSDN查到相关内容。</p>
<h2>后话</h2>
<p>MemberShip是一个很强大的框架，无论是使用还是学习，都是不错的对象。我这里只是一个星期使用的一点小心得，不是一个HowTo。 .NET既然提供了这么好的东西，希望大家可以用起来，而不要简单的使用User+代码中判断User的某个权限字段，要把耦合的思想和设计模式的思想在实际中进行一些尝试。（好吧，我设计模式其实基本不懂&#8220;`会吹吹罢了）</p>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2009/11/membership-the-use-of-experience.html">http://dddspace.com/2009/11/membership-the-use-of-experience.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2009/11/thishouse-housing-sales-system.html" title="ThisHouse房屋销售系统">ThisHouse房屋销售系统</a></li><li><a href="http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html" title="MemberShip在动软生成器下UserId的问题">MemberShip在动软生成器下UserId的问题</a></li><li><a href="http://dddspace.com/2009/08/no-photo-caused-by-the.html" title="由No photo引起">由No photo引起</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2009/11/membership-the-use-of-experience.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ThisHouse房屋销售系统</title>
		<link>http://dddspace.com/2009/11/thishouse-housing-sales-system.html</link>
		<comments>http://dddspace.com/2009/11/thishouse-housing-sales-system.html#comments</comments>
		<pubDate>Thu, 05 Nov 2009 09:08:07 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[AjaxControlToolkit]]></category>
		<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[MemberShip]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12761</guid>
		<description><![CDATA[呃，这是我在一个星期内搞鼓的一个Asp.NET课程设计，没有什么太多的内容，把它发布到了Csdn了，开了5分，嗯，对得起我一个星期拼命码代码。（哦，我很无耻的使用了MG12的iNove主题&#8230;&#8230;）





<span class="readmore"><a href="http://dddspace.com/2009/11/thishouse-housing-sales-system.html" title="ThisHouse房屋销售系统">阅读全文——共619字</a></span>]]></description>
			<content:encoded><![CDATA[<p>呃，这是我在一个星期内搞鼓的一个Asp.NET课程设计，没有什么太多的内容，把它发布到了Csdn了，开了5分，嗯，对得起我一个星期拼命码代码。（哦，我很无耻的使用了<a href="http://www.neoease.com/">MG12</a>的iNove主题&hellip;&hellip;）</p>
<p><img align="middle" alt="thisHouse" border="0" height="291" src="http://dddspace.com/wp-content/uploads/2009/11/thisHouse.jpg" style="border: 0px none; display: inline;" title="thisHouse" width="579" /></p>
<p><span id="more-12761"></span></p>
<h2>readme.txt内容：</h2>
<p>This House房屋销售系统 本人大四一个课程设计，大概花费1周时间，构架2天，编码3天，零碎程序1天，论文1天。</p>
<p>程序写的不好不坏，是DAL+BLL+Model+Web三层架构，使用的动软生成器生成的简单三层框架。压缩包包括源码，数据库，一个star uml简单设计图，数据库文档，需求分析和论文。</p>
<p>系统关键词是： <strong>Asp.NET</strong>;&nbsp; <strong>MemberShip</strong>;&nbsp; <strong>iBatisNet</strong>;&nbsp; <strong>AjaxControlToolkit</strong>; <strong>房屋销售系统 </strong> 数据库使用的是一个完整的MemberShip 权限管理系统，而不是我自己写的简单User in Role，所以建议对这个MemberShip有一定了解。</p>
<p>整个系统关注的是框架的使用，对于业务逻辑关注很少，实在是我时间有限，没有更多的精力搞.NET。（我学Asp.Net 3个月了，之前是搞Java的） 如果有问题可以到http://dddspace.com留言，本人大四，会在有时间前提下回答，毕竟现在我正在找工作。</p>
<h2>我写代码时候总结的一些资料</h2>
<p><a href="http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html" target="_blank">AjaxControlToolKit控件介绍[转载]</a> <a href="http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html" target="_blank">MemberShip在动软生成器下UserId的问题</a></p>
<h2>源码下载</h2>
<p><a href="http://download.csdn.net/source/1794504">点击这里到CSDN下载</a>[5分]</p>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2009/11/thishouse-housing-sales-system.html">http://dddspace.com/2009/11/thishouse-housing-sales-system.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2009/11/membership-the-use-of-experience.html" title="MemberShip使用心得">MemberShip使用心得</a></li><li><a href="http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html" title="AjaxControlToolKit控件介绍[转载]">AjaxControlToolKit控件介绍[转载]</a></li><li><a href="http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html" title="MemberShip在动软生成器下UserId的问题">MemberShip在动软生成器下UserId的问题</a></li><li><a href="http://dddspace.com/2009/08/ajaxcontroltoolkit-amendment-in-calendarextender-styles.html" title="AjaxControlToolkit中CalendarExtender样式修正">AjaxControlToolkit中CalendarExtender样式修正</a></li><li><a href="http://dddspace.com/2009/08/no-photo-caused-by-the.html" title="由No photo引起">由No photo引起</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2009/11/thishouse-housing-sales-system.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AjaxControlToolKit控件介绍[转载]</title>
		<link>http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html</link>
		<comments>http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:58:58 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[AjaxControlToolkit]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12756</guid>
		<description><![CDATA[来源：ajax toolkit 控件介绍 &#8211; 欢迎来到哈哈的天堂 &#8211; 博客园（只是来源，感觉不是这个博客原创，作者应该未知）

文字太多了，所以我没有把代码提取到代码段，只是把标题提出来了，大家不要介意啊…^_^

1.Accordion

<span class="readmore"><a href="http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html" title="AjaxControlToolKit控件介绍[转载]">阅读全文——共29250字</a></span>]]></description>
			<content:encoded><![CDATA[<p>来源：<a href="http://www.cnblogs.com/haha8/archive/2009/09/26/1574412.html">ajax toolkit 控件介绍 &#8211; 欢迎来到哈哈的天堂 &#8211; 博客园</a>（只是来源，感觉不是这个博客原创，作者应该未知）</p>
<p>文字太多了，所以我没有把代码提取到代码段，只是把标题提出来了，大家不要介意啊…^_^</p>
<h3>1.Accordion</h3>
<p>&#160;&#160; 功能：实现了QQ、Msn好友分类的折叠效果，就像包含了多个CollapsiblePanels    <br />&#160;&#160; 细节： (1)不要把Accordion放在Table种同时又把 FadeTransitions 设置为True，这将引起布局混乱     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)每一个 AccordionPane control 有一个Header 和Content的 template     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)在Content中可以进行任意扩展，你什么都可以放上^_^     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (4)有三种AutoSize modes ：None(推荐) Limit&#160; Fill     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (5)Accordion表现的更像是一个容器     <br />&#160; 代码示意：&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:Accordion ID=&quot;MyAccordion&quot; runat=&quot;server&quot; SelectedIndex=&quot;0&quot; HeaderCssClass=&quot;accordionHeader&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ContentCssClass=&quot;accordionContent&quot; FadeTransitions=&quot;false&quot; FramesPerSecond=&quot;40&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TransitionDuration=&quot;250&quot; AutoSize=&quot;None&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Panes&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:AccordionPane ID=&quot;AccordionPane1&quot; runat=&quot;server&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Header&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;a href=&quot;&quot; onclick=&quot;return false;&quot; class=&quot;accordionLink&quot;&gt;1. Accordion&lt;/a&gt;&lt;/Header&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Content&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/Content&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ajaxToolkit:AccordionPane&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/Panes&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ajaxToolkit:Accordion&gt; </p>
<p> <span id="more-12756"></span><br />
<h3>2. AlwaysVisibleControl </h3>
<p>&#160;&#160;&#160; 功能：最多的应用是在线小说的目录和不胜其烦的浮动小广告    <br />&#160;&#160; 细节： (1)避免控件闪烁，把这个控件要在目标位置时使用absolutely position     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2) HorizontalSide=&quot;Center&quot; VerticalSide=&quot;Top&quot; 使用这个方法控制浮动在什么位置     <br />代码示意：     <br />&#160;&#160;&#160; &lt;cc1:AlwaysVisibleControlExtender ID=&quot;AlwaysVisibleControlExtender1&quot; HorizontalSide=&quot;Center&quot; VerticalSide=&quot;Top&quot;&#160; TargetControlID=&quot;Panel1&quot; runat=&quot;server&quot;&gt;     </p>
<h3>3.Animation </h3>
<p>&#160;&#160; 功能：28个控件种效果最酷的！顾名思义实现动画效果    <br />&#160;&#160; 细节： (1)不只是控件：pluggable, extensible framework     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)用在什么时候：OnLoad&#160; OnClick&#160; OnMouseOver OnMouseOut OnHoverOver OnHoverOut     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)具体使用有很多可以谈的，有理由单独写一个Animation Xml 编程介绍     <br />&#160; 代码示意：     <br />&#160;&#160; &lt;ajaxToolkit:AnimationExtender ID=&quot;ae&quot;     <br />&#160; runat=&quot;server&quot; TargetControlID=&quot;ctrl&quot;&gt;     <br />&#160;&#160;&#160; &lt;Animations&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;OnLoad&gt;&#160; &lt;/OnLoad&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;OnClick&gt;&#160; &lt;/OnClick&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;OnMouseOver&gt;&#160; &lt;/OnMouseOver&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;OnMouseOut&gt;&#160; &lt;/OnMouseOut&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;OnHoverOver&gt;&#160; &lt;/OnHoverOver&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;OnHoverOut&gt;&#160; &lt;/OnHoverOut&gt;     <br />&#160;&#160;&#160; &lt;/Animations&gt;     <br />&lt;/ajaxToolkit:AnimationExtender&gt;     </p>
<h3>4.CascadingDropDown </h3>
<p>&#160;&#160; 功能：DropDownList联动，调用Web Service    <br />&#160;&#160; 细节： (1)DropDownList行为扩展     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)如果使用Web service 方法签名必须符合下面的形式：     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [WebMethod]     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public CascadingDropDownNameValue[] GetDropDownContents(     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; string knownCategoryValues, string category){&#8230;}     <br />代码示意：     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:CascadingDropDown ID=&quot;CascadingDropDown1&quot; runat=&quot;server&quot; TargetControlID=&quot;DropDownList1&quot; Category=&quot;Make&quot;&#160; PromptText=&quot;Please select a make&quot;&#160; LoadingText=&quot;[Loading makes]&quot;&#160; ServicePath=&quot;CarsService.asmx&quot; ServiceMethod=&quot;GetDropDownContents&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:CascadingDropDown ID=&quot;CascadingDropDown2&quot; runat=&quot;server&quot; TargetControlID=&quot;DropDownList2&quot; Category=&quot;Model&quot; PromptText=&quot;Please select a model&quot; LoadingText=&quot;[Loading models]&quot; ServiceMethod=&quot;GetDropDownContentsPageMethod&quot; ParentControlID=&quot;DropDownList1&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:CascadingDropDown ID=&quot;CascadingDropDown3&quot; runat=&quot;server&quot; TargetControlID=&quot;DropDownList3&quot; Category=&quot;Color&quot; PromptText=&quot;Please select a color&quot; LoadingText=&quot;[Loading colors]&quot; ServicePath=&quot;~/CascadingDropDown/CarsService.asmx&quot; ServiceMethod=&quot;GetDropDownContents&quot; ParentControlID=&quot;DropDownList2&quot;/&gt;     </p>
<h3>&#160;&#160; 5.CollapsiblePanel </h3>
<p>&#160;&#160; 功能：Xp任务栏折叠效果    <br />&#160;&#160; 细节： (1)可以扩展任何一个 ASP.NET Panel control     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2) CollapsiblePanel 默认认为使用了 标准 CSS box model 早期的浏览器要!DOCTYPE 中设置页面为自适应方式提交数据rendered in IE&#8217;s standards-compliant mode.     <br />代码示意：     <br />&#160;&#160; &lt;ajaxToolkit:CollapsiblePanelExtender ID=&quot;cpe&quot; runat=&quot;Server&quot;     <br />&#160;&#160;&#160; TargetControlID=&quot;Panel1&quot;     <br />&#160;&#160;&#160; CollapsedSize=&quot;0&quot;     <br />&#160;&#160;&#160; ExpandedSize=&quot;300&quot;     <br />&#160;&#160;&#160; Collapsed=&quot;True&quot;     <br />&#160;&#160;&#160; ExpandControlID=&quot;LinkButton1&quot;     <br />&#160;&#160;&#160; CollapseControlID=&quot;LinkButton1&quot;     <br />&#160;&#160;&#160; AutoCollapse=&quot;False&quot;     <br />&#160;&#160;&#160; AutoExpand=&quot;False&quot;     <br />&#160;&#160;&#160; ScrollContents=&quot;True&quot;     <br />&#160;&#160;&#160; TextLabelID=&quot;Label1&quot;     <br />&#160;&#160;&#160; CollapsedText=&quot;Show Details&quot;     <br />&#160;&#160;&#160; OpenedText=&quot;Hide Details&quot;     <br />&#160;&#160;&#160; ImageControlID=&quot;Image1&quot;     <br />&#160;&#160;&#160; ExpandedImage=&quot;~/images/collapse.jpg&quot;     <br />&#160;&#160;&#160; CollapsedImage=&quot;~/images/expand.jpg&quot;     <br />&#160;&#160;&#160; ExpandDirection=&quot;Height&quot;/&gt;     </p>
<h3>&#160;&#160; 6.ConfirmButton </h3>
<p>&#160;&#160; 功能：就是弹出来一个确定对话框    <br />&#160;&#160; 细节： 本人认为不是最简单实现的方法，我的方法：     <br />&#160;&#160; this.Button1.Attributes[&quot;onclick&quot;]=&quot;javascript:return confirm(&#8216;确定要停止下载么？&#8217;);&quot;;     <br />&#160;&#160;&#160;&#160;&#160; 不知道是不是我没有发现这个控件的其它优势。     </p>
<h3>7.DragPanel </h3>
<p>&#160;&#160; 功能：页面拖动    <br />&#160;&#160; 细节： (1)TargetControlID 要拖动的控件     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)DragHandleID&#160;&#160; 拖动的标题栏所在的ControlID     <br />代码示意     <br />&lt;ajaxToolkit:DragPanelExtender ID=&quot;DPE1&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160; TargetControlID=&quot;Panel3&quot;     <br />&#160;&#160;&#160; DragHandleID=&quot;Panel4&quot; /&gt;     </p>
<h3>8.DropDown </h3>
<p>&#160;&#160; 功能：什么都可以以下拉菜单的形式弹出来    <br />&#160;&#160; 细节： (1)TargetControlID要在什么控件上实现扩展     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)DropDownControlID弹出来什么     <br />代码示意：     <br />&#160; &lt;asp:Panel ID=&quot;DropPanel&quot; runat=&quot;server&quot; CssClass=&quot;ContextMenuPanel&quot; Style=&quot;display: none;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; visibility: hidden;&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:LinkButton runat=&quot;server&quot; ID=&quot;Option1&quot; Text=&quot;Option 1&quot; CssClass=&quot;ContextMenuItem&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; OnClick=&quot;OnSelect&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:LinkButton runat=&quot;server&quot; ID=&quot;Option2&quot; Text=&quot;Option 2&quot; CssClass=&quot;ContextMenuItem&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; OnClick=&quot;OnSelect&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:LinkButton runat=&quot;server&quot; ID=&quot;Option3&quot; Text=&quot;Option 3 (Click Me!)&quot; CssClass=&quot;ContextMenuItem&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; OnClick=&quot;OnSelect&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/asp:Panel&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;cc1:DropDownExtender runat=&quot;server&quot; ID=&quot;DDE&quot; TargetControlID=&quot;TextLabel&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DropDownControlID=&quot;DropPanel&quot; /&gt;     </p>
<h3>9.DropShadow </h3>
<p>&#160;&#160; 功能：阴影效果，其实可以放给美工实现    <br />&#160;&#160; 细节： (1)Width 单位：px&#160; 默认5px     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)Opacity&#160; 不透明度0-1.0 默认.5     <br />&#160; 代码示意：     <br />&#160;&#160;&#160; &lt;ajaxToolkit:DropShadowExtender ID=&quot;dse&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; TargetControlID=&quot;Panel1&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Opacity=&quot;.8&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Rounded=&quot;true&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; TrackPosition=&quot;true&quot; /&gt;     </p>
<h3>10.DynamicPopulate </h3>
<p>&#160;&#160; 功能：能实用Web Service或页面方法来替换控件的内容    <br />&#160;&#160; 细节： (1)ClearContentsDuringUpdate&#160; 替换之前先清除以前的内容（默认True）     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)PopulateTriggerControlID 触发器绑定的控件 单击时触发     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)ContextKey传递给Web Service的随机字符串     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (4) Web Service方法签名必须符合下面的形式：     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [WebMethod]     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; string DynamicPopulateMethod(string contextKey)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#8230;}     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Note you can replace &quot;DynamicPopulateMethod&quot; with a naming of your choice, but the return     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type and parameter name and type must exactly match, including case.     <br />代码示意：     <br />&lt;ajaxToolkit:DynamicPopulateExtender ID=&quot;dp&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160; TargetControlID=&quot;Panel1&quot;     <br />&#160;&#160;&#160; ClearContentsDuringUpdate=&quot;true&quot;     <br />&#160;&#160;&#160; PopulateTriggerControlID=&quot;Label1&quot;     <br />&#160;&#160;&#160; ServiceMethod=&quot;GetHtml&quot;     <br />&#160;&#160;&#160; UpdatingCssClass=&quot;dynamicPopulate_Updating&quot; /&gt;     </p>
<h3>11.FilteredTextBox </h3>
<p>&#160;&#160; 功能：文本框数据过滤    <br />&#160;&#160; 细节： (1)过滤条件Numbers LowercaseLetters UppercaseLetters&#160;&#160; Custom     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)过滤条件也可以是Custom的组合 FilterType=&quot;Custom, Numbers&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)ValidChars=&quot;+-=/*().&quot; Custom要定义这样的有效字符串     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (4) 其实这是个鸡肋：你可以输入中文，聊胜于无，忍了     <br />示意代码：     <br />&lt;ajaxToolkit:FilteredTextBoxExtender ID=&quot;ftbe&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; TargetControlID=&quot;TextBox3&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; FilterType=&quot;Custom, Numbers&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ValidChars=&quot;+-=/*().&quot; /&gt;     </p>
<h3>12.HoverMenu </h3>
<p>&#160;&#160; 功能：鼠标靠近时显示菜单，可以用在在线数据修改的表格上作为功能菜单    <br />&#160;&#160; 细节： (1)PopupControlID要弹出来什么     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)PopupPostion 在哪里弹出来Left (Default), Right, Top, Bottom, Center.     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)OffsetX/OffsetY 弹出项与源控件的距离     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (4) PopDelay 弹出延时显示 单位milliseconds. Default is 100.     <br />代码示意：     <br />&lt;ajaxToolkit:HoverMenuExtender ID=&quot;hme2&quot; runat=&quot;Server&quot;     <br />&#160;&#160;&#160; TargetControlID=&quot;Panel9&quot;     <br />&#160;&#160;&#160; HoverCssClass=&quot;popupHover&quot;     <br />&#160;&#160;&#160; PopupControlID=&quot;PopupMenu&quot;     <br />&#160;&#160;&#160; PopupPosition=&quot;Left&quot;     <br />&#160;&#160;&#160; OffsetX=&quot;0&quot;     <br />&#160;&#160;&#160; OffsetY=&quot;0&quot;     <br />&#160;&#160;&#160; PopDelay=&quot;50&quot; /&gt;     </p>
<h3>13.ModalPopup </h3>
<p>&#160;&#160; 功能：Xp的关机效果，后面全部灰掉，很多邮箱的删除对话框都着种效果    <br />&#160;&#160; 细节： (1)本质上讲这是一个对话框模版，比ConfirmButton有意义有更强的扩展性！     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)从下面的代码中我们发现 点OK的时候可以调用后台方法     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)同时可以执行一段脚本     <br />代码示意：     <br />&#160; &lt;asp:Panel ID=&quot;Panel2&quot; runat=&quot;server&quot; CssClass=&quot;modalPopup&quot; style=&quot;display:none&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:Label ID=&quot;Label1&quot; runat=&quot;server&quot; BackColor=&quot;Blue&quot; ForeColor=&quot;White&quot; Style=&quot;position: relative&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Text=&quot;信息提示&quot;&gt;&lt;/asp:Label&gt;&amp;nbsp;&lt;/p&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p &gt;确定要删除当前下载的任务么？&lt;/p&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p style=&quot;text-align:center;&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;OK&quot; &gt;&lt;/asp:Button&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:Button ID=&quot;Button2&quot; runat=&quot;server&quot; Text=&quot;Cancel&quot;&gt;&lt;/asp:Button&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/p&gt;     <br />&#160;&#160;&#160; &lt;/asp:Panel&gt;     <br />&#160;&#160;&#160; &lt;ajaxToolkit:ModalPopupExtender ID=&quot;ModalPopupExtender&quot; runat=&quot;server&quot; TargetControlID=&quot;LinkButton1&quot;     <br />&#160;&#160;&#160; PopupControlID=&quot;Panel2&quot; BackgroundCssClass=&quot;modalBackground&quot; DropShadow=&quot;true&quot;     <br />&#160;&#160;&#160; OkControlID=&quot;Button1&quot; OnOkScript=&quot;onOk()&quot; CancelControlID=&quot;CancelButton&quot; /&gt;     </p>
<h3>14.MutuallyExlcusiveCheckBox </h3>
<p>&#160;&#160; 功能：互斥复选框就像Radio一样    <br />&#160;&#160; 细节： (1)Key属性用来分组就像RdiolistGroup一样     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)argetControlID用来绑定已有的CheckBox     <br />&#160;&#160; 代码示意：     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:MutuallyExclusiveCheckboxExtender runat=&quot;server&quot;     <br />&#160;&#160;&#160; ID=&quot;MustHaveGuestBedroomCheckBoxEx&quot;     <br />&#160;&#160;&#160; TargetControlID=&quot;MustHaveGuestBedroomCheckBox&quot;     <br />&#160;&#160;&#160; Key=&quot;GuestBedroomCheckBoxes&quot; /&gt;     </p>
<h3>15.NoBot </h3>
<p>&#160;&#160; 功能：Captcha 图灵测试 反垃圾信息控件    <br />&#160;&#160; 细节： (1)OnGenerateChallengeAndResponse 这个属性是EventHandler&lt;NoBotEventArgs&gt; 调用服务器端的方法，注意方法签名     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 例如：&#160;&#160; protected void CustomChallengeResponse(object sender, NoBotEventArgs e) {……} 代码示意：     <br />&#160;&#160;&#160; &lt;ajaxToolkit:NoBot     <br />&#160; ID=&quot;NoBot2&quot;     <br />&#160; runat=&quot;server&quot;     <br />&#160; OnGenerateChallengeAndResponse=&quot;CustomChallengeResponse&quot;     <br />&#160; ResponseMinimumDelaySeconds=&quot;2&quot;     <br />&#160; CutoffWindowSeconds=&quot;60&quot;     <br />&#160; CutoffMaximumInstances=&quot;5&quot; /&gt;     </p>
<h3>16.NumericUpDown </h3>
<p>&#160;&#160; 功能：实现Winform里面的Updown    <br />&#160;&#160; 细节： (1)普通整数增减     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)值列表循环显示比如下面的第二个例子RefValues     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)调用Web Service的格式：     <br />&lt;ajaxToolkit:NumericUpDownExtender ID=&quot;NUD1&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160; TargetControlID=&quot;TextBox1&quot;     <br />&#160;&#160;&#160; Width=&quot;100&quot;     <br />&#160;&#160;&#160; RefValues=&quot;January;February;March;April&quot;     <br />&#160;&#160;&#160; TargetButtonDownID=&quot;Button1&quot;     <br />&#160;&#160;&#160; TargetButtonUpID=&quot;Button2&quot;     <br />&#160;&#160;&#160; ServiceDownPath=&quot;WebService1.asmx&quot;     <br />&#160;&#160;&#160; ServiceDownMethod=&quot;PrevValue&quot;     <br />&#160;&#160;&#160; ServiceUpPath=&quot;WebService1.asmx&quot;     <br />&#160;&#160;&#160; ServiceUpMethod=&quot;NextValue&quot;     <br />&#160;&#160;&#160; Tag=&quot;1&quot; /&gt;     <br />代码示意：     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:NumericUpDownExtender ID=&quot;NumericUpDownExtender1&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TargetControlID=&quot;TextBox1&quot; Width=&quot;120&quot; RefValues=&quot;&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ServiceDownMethod=&quot;&quot; ServiceUpMethod=&quot;&quot; TargetButtonDownID=&quot;&quot; TargetButtonUpID=&quot;&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:NumericUpDownExtender ID=&quot;NumericUpDownExtender2&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TargetControlID=&quot;TextBox2&quot; Width=&quot;120&quot; RefValues=&quot;January;February;March;April;May;June;July;August;September;October;November;December&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ServiceDownMethod=&quot;&quot; ServiceUpMethod=&quot;&quot; TargetButtonDownID=&quot;&quot; TargetButtonUpID=&quot;&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:NumericUpDownExtender ID=&quot;NumericUpDownExtender4&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TargetControlID=&quot;TextBox4&quot; Width=&quot;80&quot; TargetButtonDownID=&quot;img1&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TargetButtonUpID=&quot;img2&quot; RefValues=&quot;&quot; ServiceDownMethod=&quot;&quot; ServiceUpMethod=&quot;&quot; /&gt;     </p>
<h3>17.PagingBulletedList </h3>
<p>&#160;&#160; 功能：扩展BulletedList的分页功能    <br />&#160;&#160; 细节： (1)可以控制每页最多显示多少条，是否排序     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)IndexSize表示index headings 的字符数，如果MaxItemPerPage设置了概属性被忽略     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)MaxItemPerPage分页每页最大条数     <br />代码示意：     <br />&lt;ajaxToolkit:PagingBulletedListExtender ID=&quot;PagingBulletedListExtender1&quot; BehaviorID=&quot;PagingBulletedListBehavior1&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TargetControlID=&quot;BulletedList1&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ClientSort=&quot;true&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; IndexSize=&quot;1&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Separator=&quot; &#8211; &quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SelectIndexCssClass=&quot;selectIndex&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UnselectIndexCssClass=&quot;unselectIndex&quot; /&gt; </p>
<h3>18.PasswordStrength </h3>
<p>&#160;&#160; 功能：验证密码强度    <br />&#160;&#160; 细节： StrengthIndicatorType两种显示方式：文字提示，进度条提示     <br />代码示意：     <br />&lt;ajaxToolkit:PasswordStrength ID=&quot;PasswordStrength1&quot; runat=&quot;server&quot; DisplayPosition=&quot;RightSide&quot; TargetControlID=&quot;TextBox1&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StrengthIndicatorType=&quot;Text&quot; PreferredPasswordLength=&quot;10&quot; PrefixText=&quot;Strength:&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; HelpStatusLabelID=&quot;TextBox1_HelpLabel&quot; TextCssClass=&quot;TextIndicator_TextBox1&quot;&#160; TextStrengthDescriptions=&quot;Very Poor;Weak;Average;Strong;Excellent&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MinimumNumericCharacters=&quot;0&quot; MinimumSymbolCharacters=&quot;0&quot; RequiresUpperAndLowerCaseCharacters=&quot;false&quot;/&gt;     <br />&#160;&#160;&#160; &lt;ajaxToolkit:PasswordStrength ID=&quot;PasswordStrength2&quot; runat=&quot;server&quot; DisplayPosition=&quot;RightSide&quot; TargetControlID=&quot;TextBox2&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StrengthIndicatorType=&quot;BarIndicator&quot; PreferredPasswordLength=&quot;15&quot; HelpStatusLabelID=&quot;TextBox2_HelpLabel&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BarIndicatorCssClass=&quot;BarIndicator_TextBox2&quot; BarBorderCssClass=&quot;BarBorder_TextBox2&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MinimumNumericCharacters=&quot;1&quot; MinimumSymbolCharacters=&quot;1&quot; RequiresUpperAndLowerCaseCharacters=&quot;true&quot; /&gt;     <br />&#160;&#160;&#160; &lt;ajaxToolkit:PasswordStrength ID=&quot;PasswordStrength3&quot; runat=&quot;server&quot; DisplayPosition=&quot;BelowLeft&quot; TargetControlID=&quot;TextBox3&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StrengthIndicatorType=&quot;Text&quot; PreferredPasswordLength=&quot;20&quot; PrefixText=&quot;Meets Policy? &quot; TextCssClass=&quot;TextIndicator_TextBox3&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MinimumNumericCharacters=&quot;2&quot; MinimumSymbolCharacters=&quot;2&quot; RequiresUpperAndLowerCaseCharacters=&quot;true&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TextStrengthDescriptions=&quot;Not at all;Very Low compliance;Low Compliance;Average Compliance;Good Compliance;Very High Compliance;Yes&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; HelpHandleCssClass=&quot;TextIndicator_TextBox3_Handle&quot; HelpHandlePosition=&quot;LeftSide&quot; /&gt;     </p>
<h3>19.PopupControl </h3>
<p>&#160;&#160; 功能：任何控件上都可以弹出任何内容    <br />&#160;&#160; 细节： (1)TargetControlID &#8211; The ID of the control to attach to     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)PopupControlID &#8211; The ID of the control to display     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)CommitProperty -属性来标识返回的值     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (4) CommitScript -把返回结果值通过脚本处理，用到CommitProperty     <br />&#160; 代码示意：     <br />&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:PopupControlExtender&#160; ID=&quot;PopupControlExtender2&quot; runat=&quot;server&quot; TargetControlID=&quot;MessageTextBox&quot;     <br />&#160;&#160;&#160;&#160;&#160; PopupControlID=&quot;Panel2&quot; CommitProperty=&quot;value&quot; CommitScript=&quot;e.value += &#8216; &#8211; do not forget!&#8217;;&quot; Position=&quot;Bottom&quot; /&gt;     </p>
<h3>20.Rating </h3>
<p>&#160;&#160; 功能：级别控件    <br />&#160;&#160; 细节： 又是一个鸡肋，没有太大实用价值，看代码吧     <br />&#160;&#160; 代码示意：     <br />&#160;&#160; &lt;ajaxToolkit:Rating ID=&quot;ThaiRating&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160; CurrentRating=&quot;2&quot;     <br />&#160;&#160;&#160; MaxRating=&quot;5&quot;     <br />&#160;&#160;&#160; StarCssClass=&quot;ratingStar&quot;     <br />&#160;&#160;&#160; WaitingStarCssClass=&quot;savedRatingStar&quot;     <br />&#160;&#160;&#160; FilledStarCssClass=&quot;filledRatingStar&quot;     <br />&#160;&#160;&#160; EmptyStarCssClass=&quot;emptyRatingStar&quot;     <br />&#160;&#160;&#160; OnChanged=&quot;ThaiRating_Changed&quot; /&gt;     </p>
<h3>21.ReorderList </h3>
<p>&#160;&#160; 功能：这个控件的炫酷程度仅次于Animation ，可以动态移动数据    <br />&#160;&#160; 细节： (1)绑定数据，拖动数据之后数据将被更新到绑定源     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)它不是已有控件的扩展是全新的服务器端控件，只是它对Ajax行为是敏感的     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)重排的实现有两种方式：CallBack PostBack 前者的发生在页面上是没有PostBack的（也就是没有刷新页面）     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (4) 而数据添加或者编辑的时候就必须要使用PostBack来同步服务器端的数据状态     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (5)PostbackOnReorder就是针对两种策略进行选择     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (6)可以扩展的很多，三言两语难以说尽给出基本框架吧，回头再说     <br />代码示意：     <br />&#160;&#160; &lt;ajaxToolkit:ReorderList ID=&quot;ReorderList1&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160; DataSourceID=&quot;ObjectDataSource1&quot;     <br />&#160;&#160;&#160; DragHandleAlignment=&quot;Left&quot;     <br />&#160;&#160;&#160; ItemInsertLocation=&quot;Beginning&quot;     <br />&#160;&#160;&#160; DataKeyField=&quot;ItemID&quot;     <br />&#160;&#160;&#160; SortOrderField=&quot;Priority&quot;     <br />&#160;&#160;&#160; AllowReorder=&quot;true&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160; &lt;ItemTemplate&gt;&lt;/ItemTemplate&gt;     <br />&#160;&#160;&#160;&#160;&#160; &lt;ReorderTemplate&gt;&lt;/ReorderTemplate&gt;     <br />&#160;&#160;&#160;&#160;&#160; &lt;DragHandleTemplate&gt;&lt;/DragHandleTemplate&gt;     <br />&#160;&#160;&#160;&#160;&#160; &lt;InsertItemTemplate&gt;&lt;/InsertItemTemplate&gt;     <br />&lt;/ajaxToolkit:ReorderList&gt;     </p>
<h3>22.ResizableControl </h3>
<p>&#160;&#160; 功能：就像设计状态一样可以拖动修改大小，可是有什么实际的意义么，放大字体？没有想到    <br />&#160;&#160; 细节： (1)HandleCssClass &#8211; The name of the CSS class to apply to the resize handle 这个属性必须要有！     <br />&#160; 代码示意：     <br />&lt;ajaxToolkit:ResizableControlExtender ID=&quot;RCE&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160; TargetControlID=&quot;PanelImage&quot;     <br />&#160;&#160;&#160; HandleCssClass=&quot;handleImage&quot;     <br />&#160;&#160;&#160; ResizableCssClass=&quot;resizingImage&quot;     <br />&#160;&#160;&#160; MinimumWidth=&quot;50&quot;     <br />&#160;&#160;&#160; MinimumHeight=&quot;20&quot;     <br />&#160;&#160;&#160; MaximumWidth=&quot;260&quot;     <br />&#160;&#160;&#160; MaximumHeight=&quot;130&quot;     <br />&#160;&#160;&#160; OnClientResize=&quot;OnClientResizeImage&quot;     <br />&#160;&#160;&#160; HandleOffsetX=&quot;3&quot;     <br />&#160;&#160;&#160; HandleOffsetY=&quot;3&quot; /&gt;     </p>
<h3>23.RoundedCorners </h3>
<p>&#160;&#160; 功能：控件圆角 纯粹是控制外观的了，什么时候审美疲劳了还要改，呵呵    <br />&#160;&#160; 细节： (1)还有一个非常非常坑人的地方：你必须要设置 CssClass=&quot;roundedPanel&quot;要不然不起作用     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2) Radius设置弧度，默认是5     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)好象只适用于容器     <br />代码示意：     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ajaxToolkit:RoundedCornersExtender ID=&quot;rce&quot; runat=&quot;server&quot;&#160;&#160;&#160;&#160; TargetControlID=&quot;Panel1&quot;&#160;&#160;&#160;&#160; Radius=&quot;6&quot; /&gt;     </p>
<h3>24.Slider </h3>
<p>&#160;&#160; 功能：实现WinForm中的Slider控件效果    <br />&#160;&#160; 细节： (1)修改文本框的值也可以影响Slider的状态！这个反馈还是有用的！     <br />&#160; 代码示意：     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; &lt;cc1:SliderExtender ID=&quot;SliderExtender2&quot; runat=&quot;server&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BehaviorID=&quot;Slider2&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TargetControlID=&quot;Slider2&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BoundControlID=&quot;TextBox1&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Orientation=&quot;Horizontal&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; EnableHandleAnimation=&quot;true&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Minimum=&quot;0&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Maximum=&quot;100&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /&gt; </p>
<h3>25.TextBoxWatermark </h3>
<p>&#160;&#160; 功能：文本水印    <br />&#160;&#160; 细节： 没有什么说的看代码&#8212;&gt;     <br />代码示意：     <br />&#160;&#160;&#160; &lt;asp:TextBox ID=&quot;TextBox1&quot; CssClass=&quot;unwatermarked&quot; Width=&quot;150&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;cc1:TextBoxWatermarkExtender ID=&quot;TextBoxWatermarkExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;TextBox1&quot; WatermarkText=&quot;请输入用户名&quot; WatermarkCssClass=&quot;watermarked&quot; /&gt;     </p>
<h3>26.UpdatePanelAnimation </h3>
<p>&#160;&#160; 功能：更新动画效果    <br />&#160;&#160; 细节：代码结构简单但是要说的东西很多，回头再说写专题吧     <br />代码示意：     <br />&#160; &lt;ajaxToolkit:UpdatePanelAnimationExtender ID=&quot;ae&quot;     <br />&#160; runat=&quot;server&quot; TargetControlID=&quot;up&quot;&gt;     <br />&#160;&#160;&#160;&#160; &lt;Animations&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;OnUpdating&gt;&#160; &lt;/OnUpdating&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;OnUpdated&gt;&#160; &lt;/OnUpdated&gt;     <br />&#160;&#160;&#160; &lt;/Animations&gt;     <br />&lt;/ajaxToolkit:UpdatePanelAnimationExtender&gt;     </p>
<h3>27.ToggleButton </h3>
<p>&#160;&#160; 功能：就是把一个CheckBox的逻辑应用到一个按钮上，于是就有了双态按钮这么个玩意，有点意思啊    <br />&#160;&#160; 闲言少叙，看代码：     <br />&lt;asp:CheckBox ID=&quot;CheckBox1&quot; Checked=&quot;true&quot; Text=&quot;I like ASP.NET&quot; runat=&quot;server&quot;/&gt;     <br />&#160;&#160;&#160; &lt;cc1:ToggleButtonExtender ID=&quot;ToggleButtonExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;CheckBox1&quot; ImageWidth=&quot;19&quot;     <br />&#160;&#160;&#160;&#160; ImageHeight=&quot;19&quot; UncheckedImageUrl=&quot;Image/down.gif&quot; CheckedImageUrl=&quot;Image/up.gif&quot; CheckedImageAlternateText=&quot;Check&quot;     <br />&#160;&#160;&#160;&#160; UncheckedImageAlternateText=&quot;UnCheck&quot; /&gt;     </p>
<h3>28.ValidatorCallout </h3>
<p>&#160;&#160; 功能：Windows系统中最常见的气泡提示，比如你磁盘空间不足的时候……    <br />&#160;&#160; 细节： 是对数据验证控件的扩展，比较新鲜     <br />代码示意：     <br />&lt;asp:RequiredFieldValidator runat=&quot;server&quot; ID=&quot;NReq&quot; ControlToValidate=&quot;NameTextBox&quot; Display=&quot;None&quot; ErrorMessage=&quot;&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br /&gt;A name is required.&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:RequiredFieldValidator runat=&quot;server&quot; ID=&quot;PNReq&quot; ControlToValidate=&quot;PhoneNumberTextBox&quot; Display=&quot;None&quot; ErrorMessage=&quot;&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br /&gt;A phone number is required.&lt;div style=&#8217;margin-top:5px;padding:5px;border:1px solid #e9e9e9;background-color:white;&#8217;&gt;&lt;b&gt;Other Options:&lt;/b&gt;&lt;br /&gt;&lt;a href=&#8217;javascript:alert(&amp;quot;not implemented but you get the idea;)&amp;quot;);&#8217;&gt;Extract from Profile&lt;/a&gt;&lt;/div&gt;&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:RegularExpressionValidator runat=&quot;server&quot; ID=&quot;PNRegEx&quot; ControlToValidate=&quot;PhoneNumberTextBox&quot; Display=&quot;None&quot; ErrorMessage=&quot;&lt;b&gt;Invalid Field&lt;/b&gt;&lt;br /&gt;Please enter a phone number in the format:&lt;br /&gt;(###) ###-####&quot; ValidationExpression=&quot;((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;cc1:ValidatorCalloutExtender runat=&quot;Server&quot; ID=&quot;NReqE&quot; TargetControlID=&quot;NReq&quot; HighlightCssClass=&quot;highlight&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;cc1:ValidatorCalloutExtender runat=&quot;Server&quot; ID=&quot;PNReqE&quot; TargetControlID=&quot;PNReq&quot; HighlightCssClass=&quot;highlight&quot; Width=&quot;350px&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;cc1:ValidatorCalloutExtender runat=&quot;Server&quot; ID=&quot;PNReqEx&quot; TargetControlID=&quot;PNRegEx&quot; HighlightCssClass=&quot;highlight&quot; /&gt;</p>
<div id="_mcePaste" style="left: -10000px; overflow: hidden; width: 1px; position: absolute; top: 0px; height: 1px"><span style="font-size: 13px; line-height: 1.8em">1.Accordion      <br />功能：实现了QQ、Msn好友分类的折叠效果，就像包含了多个CollapsiblePanels       <br />细节： (1)不要把Accordion放在Table种同时又把 FadeTransitions 设置为True，这将引起布局混乱       <br />(2)每一个 AccordionPane control 有一个Header 和Content的 template       <br />(3)在Content中可以进行任意扩展，你什么都可以放上^_^       <br />(4)有三种AutoSize modes ：None(推荐) Limit&#160; Fill       <br />(5)Accordion表现的更像是一个容器 </span>
<div id="blogDetailDiv" style="font-size: 16px"><span style="font-size: 13px; line-height: 1.8em">代码示意：        <br />&lt;ajaxToolkit:Accordion ID=&quot;MyAccordion&quot; runat=&quot;server&quot; SelectedIndex=&quot;0&quot; HeaderCssClass=&quot;accordionHeader&quot;         <br />ContentCssClass=&quot;accordionContent&quot; FadeTransitions=&quot;false&quot; FramesPerSecond=&quot;40&quot;         <br />TransitionDuration=&quot;250&quot; AutoSize=&quot;None&quot;&gt;         <br />&lt;Panes&gt;         <br />&lt;ajaxToolkit:AccordionPane ID=&quot;AccordionPane1&quot; runat=&quot;server&quot;&gt;         <br />&lt;Header&gt;         <br />&lt;a href=&quot;&quot; onclick=&quot;return false;&quot; class=&quot;accordionLink&quot;&gt;1. Accordion&lt;/a&gt;&lt;/Header&gt;         <br />&lt;Content&gt;         <br />&lt;/Content&gt;         <br />&lt;/ajaxToolkit:AccordionPane&gt;         <br />&lt;/Panes&gt;         <br />&lt;/ajaxToolkit:Accordion&gt;         <br /></span>      <br /><span style="font-size: 13px; line-height: 1.8em">2. AlwaysVisibleControl        <br />功能：最多的应用是在线小说的目录和不胜其烦的浮动小广告         <br />细节： (1)避免控件闪烁，把这个控件要在目标位置时使用absolutely position         <br />(2) HorizontalSide=&quot;Center&quot; VerticalSide=&quot;Top&quot; 使用这个方法控制浮动在什么位置</span>       <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：        <br />&lt;cc1:AlwaysVisibleControlExtender ID=&quot;AlwaysVisibleControlExtender1&quot; HorizontalSide=&quot;Center&quot; VerticalSide=&quot;Top&quot;&#160; TargetControlID=&quot;Panel1&quot; runat=&quot;server&quot;&gt;</span>       <br /><span style="font-size: 13px; line-height: 1.8em">3.Animation        <br />功能：28个控件种效果最酷的！顾名思义实现动画效果         <br />细节： (1)不只是控件：pluggable, extensible framework         <br />(2)用在什么时候：OnLoad&#160; OnClick&#160; OnMouseOver OnMouseOut OnHoverOver OnHoverOut         <br />(3)具体使用有很多可以谈的，有理由单独写一个Animation Xml 编程介绍</span>       <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：        <br />&lt;ajaxToolkit:AnimationExtender ID=&quot;ae&quot;         <br />runat=&quot;server&quot; TargetControlID=&quot;ctrl&quot;&gt;         <br />&lt;Animations&gt;         <br />&lt;OnLoad&gt;&#160; &lt;/OnLoad&gt;         <br />&lt;OnClick&gt;&#160; &lt;/OnClick&gt;         <br />&lt;OnMouseOver&gt;&#160; &lt;/OnMouseOver&gt;         <br />&lt;OnMouseOut&gt;&#160; &lt;/OnMouseOut&gt;         <br />&lt;OnHoverOver&gt;&#160; &lt;/OnHoverOver&gt;         <br />&lt;OnHoverOut&gt;&#160; &lt;/OnHoverOut&gt;         <br />&lt;/Animations&gt;         <br />&lt;/ajaxToolkit:AnimationExtender&gt;</span>       <br /><span style="font-size: 13px; line-height: 1.8em">4.CascadingDropDown        <br />功能：DropDownList联动，调用Web Service         <br />细节： (1)DropDownList行为扩展         <br />(2)如果使用Web service 方法签名必须符合下面的形式：         <br />[WebMethod]         <br />public CascadingDropDownNameValue[] GetDropDownContents(         <br />string knownCategoryValues, string category){&#8230;}</span>       <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：        <br />&lt;ajaxToolkit:CascadingDropDown ID=&quot;CascadingDropDown1&quot; runat=&quot;server&quot; TargetControlID=&quot;DropDownList1&quot; Category=&quot;Make&quot;&#160; PromptText=&quot;Please select a make&quot;&#160; LoadingText=&quot;[Loading makes]&quot;&#160; ServicePath=&quot;CarsService.asmx&quot; ServiceMethod=&quot;GetDropDownContents&quot;/&gt;         <br />&lt;ajaxToolkit:CascadingDropDown ID=&quot;CascadingDropDown2&quot; runat=&quot;server&quot; TargetControlID=&quot;DropDownList2&quot; Category=&quot;Model&quot; PromptText=&quot;Please select a model&quot; LoadingText=&quot;[Loading models]&quot; ServiceMethod=&quot;GetDropDownContentsPageMethod&quot; ParentControlID=&quot;DropDownList1&quot;/&gt;         <br />&lt;ajaxToolkit:CascadingDropDown ID=&quot;CascadingDropDown3&quot; runat=&quot;server&quot; TargetControlID=&quot;DropDownList3&quot; Category=&quot;Color&quot; PromptText=&quot;Please select a color&quot; LoadingText=&quot;[Loading colors]&quot; ServicePath=&quot;~/CascadingDropDown/CarsService.asmx&quot; ServiceMethod=&quot;GetDropDownContents&quot; ParentControlID=&quot;DropDownList2&quot;/&gt;         <br /></span>      <br /><span style="font-size: 13px; line-height: 1.8em">5.CollapsiblePanel        <br />功能：Xp任务栏折叠效果         <br />细节： (1)可以扩展任何一个 ASP.NET Panel control         <br />(2) CollapsiblePanel 默认认为使用了 标准 CSS box model 早期的浏览器要!DOCTYPE 中设置页面为自适应方式提交数据rendered in IE&#8217;s standards-compliant mode.</span>       <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：        <br />&lt;ajaxToolkit:CollapsiblePanelExtender ID=&quot;cpe&quot; runat=&quot;Server&quot;         <br />TargetControlID=&quot;Panel1&quot;         <br />CollapsedSize=&quot;0&quot;         <br />ExpandedSize=&quot;300&quot;         <br />Collapsed=&quot;True&quot;         <br />ExpandControlID=&quot;LinkButton1&quot;         <br />CollapseControlID=&quot;LinkButton1&quot;         <br />AutoCollapse=&quot;False&quot;         <br />AutoExpand=&quot;False&quot;         <br />ScrollContents=&quot;True&quot;         <br />TextLabelID=&quot;Label1&quot;         <br />CollapsedText=&quot;Show Details&quot;         <br />OpenedText=&quot;Hide Details&quot;         <br />ImageControlID=&quot;Image1&quot;         <br />ExpandedImage=&quot;~/images/collapse.jpg&quot;         <br />CollapsedImage=&quot;~/images/expand.jpg&quot;         <br />ExpandDirection=&quot;Height&quot;/&gt;         <br />6.ConfirmButton         <br />功能：就是弹出来一个确定对话框         <br />细节： 本人认为不是最简单实现的方法，我的方法：         <br />this.Button1.Attributes[&quot;onclick&quot;]=&quot;javascript:return confirm(&#8216;确定要停止下载么？&#8217;);&quot;;         <br />不知道是不是我没有发现这个控件的其它优势。
<p>7.DragPanel          <br />功能：页面拖动           <br />细节： (1)TargetControlID 要拖动的控件           <br />(2)DragHandleID&#160;&#160; 拖动的标题栏所在的ControlID </p>
<p><span style="font-size: 13px; line-height: 1.8em">代码示意          <br />&lt;ajaxToolkit:DragPanelExtender ID=&quot;DPE1&quot; runat=&quot;server&quot;           <br />TargetControlID=&quot;Panel3&quot;           <br />DragHandleID=&quot;Panel4&quot; /&gt;           <br />8.DropDown           <br />功能：什么都可以以下拉菜单的形式弹出来           <br />细节： (1)TargetControlID要在什么控件上实现扩展           <br />(2)DropDownControlID弹出来什么</span>         <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;asp:Panel ID=&quot;DropPanel&quot; runat=&quot;server&quot; CssClass=&quot;ContextMenuPanel&quot; Style=&quot;display: none;           <br />visibility: hidden;&quot;&gt;           <br />&lt;asp:LinkButton runat=&quot;server&quot; ID=&quot;Option1&quot; Text=&quot;Option 1&quot; CssClass=&quot;ContextMenuItem&quot;           <br />OnClick=&quot;OnSelect&quot; /&gt;           <br />&lt;asp:LinkButton runat=&quot;server&quot; ID=&quot;Option2&quot; Text=&quot;Option 2&quot; CssClass=&quot;ContextMenuItem&quot;           <br />OnClick=&quot;OnSelect&quot; /&gt;           <br />&lt;asp:LinkButton runat=&quot;server&quot; ID=&quot;Option3&quot; Text=&quot;Option 3 (Click Me!)&quot; CssClass=&quot;ContextMenuItem&quot;           <br />OnClick=&quot;OnSelect&quot; /&gt;           <br />&lt;/asp:Panel&gt;           <br />&lt;cc1:DropDownExtender runat=&quot;server&quot; ID=&quot;DDE&quot; TargetControlID=&quot;TextLabel&quot;           <br />DropDownControlID=&quot;DropPanel&quot; /&gt;</span>         <br /><span style="font-size: 13px; line-height: 1.8em">9.DropShadow          <br />功能：阴影效果，其实可以放给美工实现           <br />细节： (1)Width 单位：px&#160; 默认5px           <br />(2)Opacity&#160; 不透明度0-1.0 默认.5</span>         <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;ajaxToolkit:DropShadowExtender ID=&quot;dse&quot; runat=&quot;server&quot;           <br />TargetControlID=&quot;Panel1&quot;           <br />Opacity=&quot;.8&quot;           <br />Rounded=&quot;true&quot;           <br />TrackPosition=&quot;true&quot; /&gt;           <br />10.DynamicPopulate           <br />功能：能实用Web Service或页面方法来替换控件的内容           <br />细节： (1)ClearContentsDuringUpdate&#160; 替换之前先清除以前的内容（默认True）           <br />(2)PopulateTriggerControlID 触发器绑定的控件 单击时触发           <br />(3)ContextKey传递给Web Service的随机字符串           <br />(4) Web Service方法签名必须符合下面的形式：           <br />[WebMethod]           <br />string DynamicPopulateMethod(string contextKey)           <br />{&#8230;}           <br />Note you can replace &quot;DynamicPopulateMethod&quot; with a naming of your choice, but the return           <br />type and parameter name and type must exactly match, including case. </span>        <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;ajaxToolkit:DynamicPopulateExtender ID=&quot;dp&quot; runat=&quot;server&quot;           <br />TargetControlID=&quot;Panel1&quot;           <br />ClearContentsDuringUpdate=&quot;true&quot;           <br />PopulateTriggerControlID=&quot;Label1&quot;           <br />ServiceMethod=&quot;GetHtml&quot;           <br />UpdatingCssClass=&quot;dynamicPopulate_Updating&quot; /&gt;</span>
<p>11.FilteredTextBox          <br />功能：文本框数据过滤           <br />细节： (1)过滤条件Numbers LowercaseLetters UppercaseLetters&#160;&#160; Custom           <br />(2)过滤条件也可以是Custom的组合 FilterType=&quot;Custom, Numbers&quot;           <br />(3)ValidChars=&quot;+-=/*().&quot; Custom要定义这样的有效字符串           <br />(4) 其实这是个鸡肋：你可以输入中文，聊胜于无，忍了</p>
<p><span style="font-size: 13px; line-height: 1.8em">示意代码：          <br />&lt;ajaxToolkit:FilteredTextBoxExtender ID=&quot;ftbe&quot; runat=&quot;server&quot;           <br />TargetControlID=&quot;TextBox3&quot;           <br />FilterType=&quot;Custom, Numbers&quot;           <br />ValidChars=&quot;+-=/*().&quot; /&gt;           <br />12.HoverMenu           <br />功能：鼠标靠近时显示菜单，可以用在在线数据修改的表格上作为功能菜单           <br />细节： (1)PopupControlID要弹出来什么           <br />(2)PopupPostion 在哪里弹出来Left (Default), Right, Top, Bottom, Center.           <br />(3)OffsetX/OffsetY 弹出项与源控件的距离           <br />(4) PopDelay 弹出延时显示 单位milliseconds. Default is 100.</span>         <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;ajaxToolkit:HoverMenuExtender ID=&quot;hme2&quot; runat=&quot;Server&quot;           <br />TargetControlID=&quot;Panel9&quot;           <br />HoverCssClass=&quot;popupHover&quot;           <br />PopupControlID=&quot;PopupMenu&quot;           <br />PopupPosition=&quot;Left&quot;           <br />OffsetX=&quot;0&quot;           <br />OffsetY=&quot;0&quot;           <br />PopDelay=&quot;50&quot; /&gt;           <br />13.ModalPopup           <br />功能：Xp的关机效果，后面全部灰掉，很多邮箱的删除对话框都着种效果           <br />细节： (1)本质上讲这是一个对话框模版，比ConfirmButton有意义有更强的扩展性！           <br />(2)从下面的代码中我们发现 点OK的时候可以调用后台方法           <br />(3)同时可以执行一段脚本</span>         <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;asp:Panel ID=&quot;Panel2&quot; runat=&quot;server&quot; CssClass=&quot;modalPopup&quot; style=&quot;display:none&quot;&gt;           <br />&lt;p&gt;           <br />&lt;asp:Label ID=&quot;Label1&quot; runat=&quot;server&quot; BackColor=&quot;Blue&quot; ForeColor=&quot;White&quot; Style=&quot;position: relative&quot;           <br />Text=&quot;信息提示&quot;&gt;&lt;/asp:Label&gt;&amp;nbsp;&lt;/p&gt;           <br />&lt;p &gt;确定要删除当前下载的任务么？&lt;/p&gt;           <br />&lt;p style=&quot;text-align:center;&quot;&gt;           <br />&lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;OK&quot; &gt;&lt;/asp:Button&gt;           <br />&lt;asp:Button ID=&quot;Button2&quot; runat=&quot;server&quot; Text=&quot;Cancel&quot;&gt;&lt;/asp:Button&gt;           <br />&lt;/p&gt;           <br />&lt;/asp:Panel&gt;           <br />&lt;ajaxToolkit:ModalPopupExtender ID=&quot;ModalPopupExtender&quot; runat=&quot;server&quot; TargetControlID=&quot;LinkButton1&quot;           <br />PopupControlID=&quot;Panel2&quot; BackgroundCssClass=&quot;modalBackground&quot; DropShadow=&quot;true&quot;           <br />OkControlID=&quot;Button1&quot; OnOkScript=&quot;onOk()&quot; CancelControlID=&quot;CancelButton&quot; /&gt;           <br />14.MutuallyExlcusiveCheckBox           <br />功能：互斥复选框就像Radio一样           <br />细节： (1)Key属性用来分组就像RdiolistGroup一样           <br />(2)argetControlID用来绑定已有的CheckBox</span>         <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;ajaxToolkit:MutuallyExclusiveCheckboxExtender runat=&quot;server&quot;           <br />ID=&quot;MustHaveGuestBedroomCheckBoxEx&quot;           <br />TargetControlID=&quot;MustHaveGuestBedroomCheckBox&quot;           <br />Key=&quot;GuestBedroomCheckBoxes&quot; /&gt;</span></span>
<div id="blogDetailDiv" style="font-size: 16px"><span style="font-size: 13px; line-height: 1.8em">15.NoBot          <br />功能：Captcha 图灵测试 反垃圾信息控件           <br />细节： (1)OnGenerateChallengeAndResponse 这个属性是EventHandler&lt;NoBotEventArgs&gt; 调用服务器端的方法，注意方法签名           <br />例如：&#160;&#160; protected void CustomChallengeResponse(object sender, NoBotEventArgs e) {……}</span><span style="font-size: 13px; line-height: 1.8em"> 代码示意：          <br />&lt;ajaxToolkit:NoBot           <br />ID=&quot;NoBot2&quot;           <br />runat=&quot;server&quot;           <br />OnGenerateChallengeAndResponse=&quot;CustomChallengeResponse&quot;           <br />ResponseMinimumDelaySeconds=&quot;2&quot;           <br />CutoffWindowSeconds=&quot;60&quot;           <br />CutoffMaximumInstances=&quot;5&quot; /&gt;           <br />16.NumericUpDown           <br />功能：实现Winform里面的Updown           <br />细节： (1)普通整数增减           <br />(2)值列表循环显示比如下面的第二个例子RefValues           <br />(3)调用Web Service的格式：
<p>&lt;ajaxToolkit:NumericUpDownExtender ID=&quot;NUD1&quot; runat=&quot;server&quot;            <br />TargetControlID=&quot;TextBox1&quot;             <br />Width=&quot;100&quot;             <br />RefValues=&quot;January;February;March;April&quot;             <br />TargetButtonDownID=&quot;Button1&quot;             <br />TargetButtonUpID=&quot;Button2&quot;             <br />ServiceDownPath=&quot;WebService1.asmx&quot;             <br />ServiceDownMethod=&quot;PrevValue&quot;             <br />ServiceUpPath=&quot;WebService1.asmx&quot;             <br />ServiceUpMethod=&quot;NextValue&quot;             <br />Tag=&quot;1&quot; /&gt;             <br />代码示意：             <br />&lt;ajaxToolkit:NumericUpDownExtender ID=&quot;NumericUpDownExtender1&quot; runat=&quot;server&quot;             <br />TargetControlID=&quot;TextBox1&quot; Width=&quot;120&quot; RefValues=&quot;&quot;             <br />ServiceDownMethod=&quot;&quot; ServiceUpMethod=&quot;&quot; TargetButtonDownID=&quot;&quot; TargetButtonUpID=&quot;&quot; /&gt;             <br />&lt;ajaxToolkit:NumericUpDownExtender ID=&quot;NumericUpDownExtender2&quot; runat=&quot;server&quot;             <br />TargetControlID=&quot;TextBox2&quot; Width=&quot;120&quot; RefValues=&quot;January;February;March;April;May;June;July;August;September;October;November;December&quot;             <br />ServiceDownMethod=&quot;&quot; ServiceUpMethod=&quot;&quot; TargetButtonDownID=&quot;&quot; TargetButtonUpID=&quot;&quot; /&gt;             <br />&lt;ajaxToolkit:NumericUpDownExtender ID=&quot;NumericUpDownExtender4&quot; runat=&quot;server&quot;             <br />TargetControlID=&quot;TextBox4&quot; Width=&quot;80&quot; TargetButtonDownID=&quot;img1&quot;             <br />TargetButtonUpID=&quot;img2&quot; RefValues=&quot;&quot; ServiceDownMethod=&quot;&quot; ServiceUpMethod=&quot;&quot; /&gt;</p>
<p><span style="font-size: 13px; line-height: 1.8em">17.PagingBulletedList            <br />功能：扩展BulletedList的分页功能             <br />细节： (1)可以控制每页最多显示多少条，是否排序             <br />(2)IndexSize表示index headings 的字符数，如果MaxItemPerPage设置了概属性被忽略             <br />(3)MaxItemPerPage分页每页最大条数</span>           <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：            <br />&lt;ajaxToolkit:PagingBulletedListExtender ID=&quot;PagingBulletedListExtender1&quot; BehaviorID=&quot;PagingBulletedListBehavior1&quot; runat=&quot;server&quot;             <br />TargetControlID=&quot;BulletedList1&quot;             <br />ClientSort=&quot;true&quot;             <br />IndexSize=&quot;1&quot;             <br />Separator=&quot; &#8211; &quot;             <br />SelectIndexCssClass=&quot;selectIndex&quot;             <br />UnselectIndexCssClass=&quot;unselectIndex&quot; /&gt; </span></span>
<p><span style="font-size: 13px; line-height: 1.8em">18.PasswordStrength            <br />功能：验证密码强度             <br />细节： StrengthIndicatorType两种显示方式：文字提示，进度条提示</span>           <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：            <br />&lt;ajaxToolkit:PasswordStrength ID=&quot;PasswordStrength1&quot; runat=&quot;server&quot; DisplayPosition=&quot;RightSide&quot; TargetControlID=&quot;TextBox1&quot;             <br />StrengthIndicatorType=&quot;Text&quot; PreferredPasswordLength=&quot;10&quot; PrefixText=&quot;Strength:&quot;             <br />HelpStatusLabelID=&quot;TextBox1_HelpLabel&quot; TextCssClass=&quot;TextIndicator_TextBox1&quot;&#160; TextStrengthDescriptions=&quot;Very Poor;Weak;Average;Strong;Excellent&quot;             <br />MinimumNumericCharacters=&quot;0&quot; MinimumSymbolCharacters=&quot;0&quot; RequiresUpperAndLowerCaseCharacters=&quot;false&quot;/&gt;             <br />&lt;ajaxToolkit:PasswordStrength ID=&quot;PasswordStrength2&quot; runat=&quot;server&quot; DisplayPosition=&quot;RightSide&quot; TargetControlID=&quot;TextBox2&quot;             <br />StrengthIndicatorType=&quot;BarIndicator&quot; PreferredPasswordLength=&quot;15&quot; HelpStatusLabelID=&quot;TextBox2_HelpLabel&quot;             <br />BarIndicatorCssClass=&quot;BarIndicator_TextBox2&quot; BarBorderCssClass=&quot;BarBorder_TextBox2&quot;             <br />MinimumNumericCharacters=&quot;1&quot; MinimumSymbolCharacters=&quot;1&quot; RequiresUpperAndLowerCaseCharacters=&quot;true&quot; /&gt;             <br />&lt;ajaxToolkit:PasswordStrength ID=&quot;PasswordStrength3&quot; runat=&quot;server&quot; DisplayPosition=&quot;BelowLeft&quot; TargetControlID=&quot;TextBox3&quot;             <br />StrengthIndicatorType=&quot;Text&quot; PreferredPasswordLength=&quot;20&quot; PrefixText=&quot;Meets Policy? &quot; TextCssClass=&quot;TextIndicator_TextBox3&quot;             <br />MinimumNumericCharacters=&quot;2&quot; MinimumSymbolCharacters=&quot;2&quot; RequiresUpperAndLowerCaseCharacters=&quot;true&quot;             <br />TextStrengthDescriptions=&quot;Not at all;Very Low compliance;Low Compliance;Average Compliance;Good Compliance;Very High Compliance;Yes&quot;             <br />HelpHandleCssClass=&quot;TextIndicator_TextBox3_Handle&quot; HelpHandlePosition=&quot;LeftSide&quot; /&gt;</span>           <br /><span style="font-size: 13px; line-height: 1.8em">19.PopupControl            <br />功能：任何控件上都可以弹出任何内容             <br />细节： (1)TargetControlID &#8211; The ID of the control to attach to             <br />(2)PopupControlID &#8211; The ID of the control to display             <br />(3)CommitProperty -属性来标识返回的值             <br />(4) CommitScript -把返回结果值通过脚本处理，用到CommitProperty</span>           <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：            <br />&lt;ajaxToolkit:PopupControlExtender&#160; ID=&quot;PopupControlExtender2&quot; runat=&quot;server&quot; TargetControlID=&quot;MessageTextBox&quot;             <br />PopupControlID=&quot;Panel2&quot; CommitProperty=&quot;value&quot; CommitScript=&quot;e.value += &#8216; &#8211; do not forget!&#8217;;&quot; Position=&quot;Bottom&quot; /&gt;</span>           <br /><span style="font-size: 13px; line-height: 1.8em">20.Rating            <br />功能：级别控件             <br />细节： 又是一个鸡肋，没有太大实用价值，看代码吧</span>           <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：            <br />&lt;ajaxToolkit:Rating ID=&quot;ThaiRating&quot; runat=&quot;server&quot;             <br />CurrentRating=&quot;2&quot;             <br />MaxRating=&quot;5&quot;             <br />StarCssClass=&quot;ratingStar&quot;             <br />WaitingStarCssClass=&quot;savedRatingStar&quot;             <br />FilledStarCssClass=&quot;filledRatingStar&quot;             <br />EmptyStarCssClass=&quot;emptyRatingStar&quot;             <br />OnChanged=&quot;ThaiRating_Changed&quot; /&gt;</span> </p>
<p>21.ReorderList          <br />功能：这个控件的炫酷程度仅次于Animation ，可以动态移动数据           <br />细节： (1)绑定数据，拖动数据之后数据将被更新到绑定源           <br />(2)它不是已有控件的扩展是全新的服务器端控件，只是它对Ajax行为是敏感的           <br />(3)重排的实现有两种方式：CallBack PostBack 前者的发生在页面上是没有PostBack的（也就是没有刷新页面）           <br />(4) 而数据添加或者编辑的时候就必须要使用PostBack来同步服务器端的数据状态           <br />(5)PostbackOnReorder就是针对两种策略进行选择           <br />(6)可以扩展的很多，三言两语难以说尽给出基本框架吧，回头再说</p>
<p><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;ajaxToolkit:ReorderList ID=&quot;ReorderList1&quot; runat=&quot;server&quot;           <br />DataSourceID=&quot;ObjectDataSource1&quot;           <br />DragHandleAlignment=&quot;Left&quot;           <br />ItemInsertLocation=&quot;Beginning&quot;           <br />DataKeyField=&quot;ItemID&quot;           <br />SortOrderField=&quot;Priority&quot;           <br />AllowReorder=&quot;true&quot;&gt;           <br />&lt;ItemTemplate&gt;&lt;/ItemTemplate&gt;           <br />&lt;ReorderTemplate&gt;&lt;/ReorderTemplate&gt;           <br />&lt;DragHandleTemplate&gt;&lt;/DragHandleTemplate&gt;           <br />&lt;InsertItemTemplate&gt;&lt;/InsertItemTemplate&gt;           <br />&lt;/ajaxToolkit:ReorderList&gt;</span>         <br /><span style="font-size: 13px; line-height: 1.8em">22.ResizableControl          <br />功能：就像设计状态一样可以拖动修改大小，可是有什么实际的意义么，放大字体？没有想到           <br />细节： (1)HandleCssClass &#8211; The name of the CSS class to apply to the resize handle 这个属性必须要有！</span>         <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;ajaxToolkit:ResizableControlExtender ID=&quot;RCE&quot; runat=&quot;server&quot;           <br />TargetControlID=&quot;PanelImage&quot;           <br />HandleCssClass=&quot;handleImage&quot;           <br />ResizableCssClass=&quot;resizingImage&quot;           <br />MinimumWidth=&quot;50&quot;           <br />MinimumHeight=&quot;20&quot;           <br />MaximumWidth=&quot;260&quot;           <br />MaximumHeight=&quot;130&quot;           <br />OnClientResize=&quot;OnClientResizeImage&quot;           <br />HandleOffsetX=&quot;3&quot;           <br />HandleOffsetY=&quot;3&quot; /&gt;           <br /></span>        <br /><span style="font-size: 13px; line-height: 1.8em">23.RoundedCorners          <br />功能：控件圆角 纯粹是控制外观的了，什么时候审美疲劳了还要改，呵呵           <br />细节： (1)还有一个非常非常坑人的地方：你必须要设置 CssClass=&quot;roundedPanel&quot;要不然不起作用           <br />(2) Radius设置弧度，默认是5           <br />(3)好象只适用于容器</span>         <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;ajaxToolkit:RoundedCornersExtender ID=&quot;rce&quot; runat=&quot;server&quot;&#160;&#160;&#160;&#160; TargetControlID=&quot;Panel1&quot;&#160;&#160;&#160;&#160; Radius=&quot;6&quot; /&gt;</span>         <br /><span style="font-size: 13px; line-height: 1.8em">         <br />24.Slider           <br />功能：实现WinForm中的Slider控件效果           <br />细节： (1)修改文本框的值也可以影响Slider的状态！这个反馈还是有用的！</span>         <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：          <br />&lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt;           <br />&lt;cc1:SliderExtender ID=&quot;SliderExtender2&quot; runat=&quot;server&quot;           <br />BehaviorID=&quot;Slider2&quot;           <br />TargetControlID=&quot;Slider2&quot;           <br />BoundControlID=&quot;TextBox1&quot;           <br />Orientation=&quot;Horizontal&quot;           <br />EnableHandleAnimation=&quot;true&quot;           <br />Minimum=&quot;0&quot;           <br />Maximum=&quot;100&quot;           <br />/&gt;</span>
</p>
<p><span style="font-size: 13px; line-height: 1.8em">25.TextBoxWatermark            <br />功能：文本水印             <br />细节： 没有什么说的看代码&#8212;&gt;</span>           <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：            <br />&lt;asp:TextBox ID=&quot;TextBox1&quot; CssClass=&quot;unwatermarked&quot; Width=&quot;150&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt;             <br />&lt;cc1:TextBoxWatermarkExtender ID=&quot;TextBoxWatermarkExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;TextBox1&quot; WatermarkText=&quot;请输入用户名&quot; WatermarkCssClass=&quot;watermarked&quot; /&gt;</span>           <br /><span style="font-size: 13px; line-height: 1.8em">26.UpdatePanelAnimation            <br />功能：更新动画效果             <br />细节：代码结构简单但是要说的东西很多，回头再说写专题吧</span>           <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：            <br />&lt;ajaxToolkit:UpdatePanelAnimationExtender ID=&quot;ae&quot;             <br />runat=&quot;server&quot; TargetControlID=&quot;up&quot;&gt;             <br />&lt;Animations&gt;             <br />&lt;OnUpdating&gt;&#160; &lt;/OnUpdating&gt;             <br />&lt;OnUpdated&gt;&#160; &lt;/OnUpdated&gt;             <br />&lt;/Animations&gt;             <br />&lt;/ajaxToolkit:UpdatePanelAnimationExtender&gt;</span>           <br /><span style="font-size: 13px; line-height: 1.8em">27.ToggleButton            <br />功能：就是把一个CheckBox的逻辑应用到一个按钮上，于是就有了双态按钮这么个玩意，有点意思啊             <br />闲言少叙，看代码：</span>           <br /><span style="font-size: 13px; line-height: 1.8em">&lt;asp:CheckBox ID=&quot;CheckBox1&quot; Checked=&quot;true&quot; Text=&quot;I like ASP.NET&quot; runat=&quot;server&quot;/&gt;            <br />&lt;cc1:ToggleButtonExtender ID=&quot;ToggleButtonExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;CheckBox1&quot; ImageWidth=&quot;19&quot;             <br />ImageHeight=&quot;19&quot; UncheckedImageUrl=&quot;Image/down.gif&quot; CheckedImageUrl=&quot;Image/up.gif&quot; CheckedImageAlternateText=&quot;Check&quot;             <br />UncheckedImageAlternateText=&quot;UnCheck&quot; /&gt;</span>           <br /><span style="font-size: 13px; line-height: 1.8em">28.ValidatorCallout            <br />功能：Windows系统中最常见的气泡提示，比如你磁盘空间不足的时候……             <br />细节： 是对数据验证控件的扩展，比较新鲜</span>           <br /><span style="font-size: 13px; line-height: 1.8em">代码示意：            <br />&lt;asp:RequiredFieldValidator runat=&quot;server&quot; ID=&quot;NReq&quot; ControlToValidate=&quot;NameTextBox&quot; Display=&quot;None&quot; ErrorMessage=&quot;&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br /&gt;A name is required.&quot; /&gt;             <br />&lt;asp:RequiredFieldValidator runat=&quot;server&quot; ID=&quot;PNReq&quot; ControlToValidate=&quot;PhoneNumberTextBox&quot; Display=&quot;None&quot; ErrorMessage=&quot;&lt;b&gt;Required Field Missing&lt;/b&gt;&lt;br /&gt;A phone number is required.&lt;div style=&#8217;margin-top:5px;padding:5px;border:1px solid #e9e9e9;background-color:white;&#8217;&gt;&lt;b&gt;Other Options:&lt;/b&gt;&lt;br /&gt;&lt;a href=&#8217;javascript:alert(&amp;quot;not implemented but you get the idea;)&amp;quot;);&#8217;&gt;Extract from Profile&lt;/a&gt;&lt;/div&gt;&quot; /&gt;             <br />&lt;asp:RegularExpressionValidator runat=&quot;server&quot; ID=&quot;PNRegEx&quot; ControlToValidate=&quot;PhoneNumberTextBox&quot; Display=&quot;None&quot; ErrorMessage=&quot;&lt;b&gt;Invalid Field&lt;/b&gt;&lt;br /&gt;Please enter a phone number in the format:&lt;br /&gt;(###) ###-####&quot; ValidationExpression=&quot;((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}&quot; /&gt;             <br />&lt;cc1:ValidatorCalloutExtender runat=&quot;Server&quot; ID=&quot;NReqE&quot; TargetControlID=&quot;NReq&quot; HighlightCssClass=&quot;highlight&quot; /&gt;             <br />&lt;cc1:ValidatorCalloutExtender runat=&quot;Server&quot; ID=&quot;PNReqE&quot; TargetControlID=&quot;PNReq&quot; HighlightCssClass=&quot;highlight&quot; Width=&quot;350px&quot; /&gt;             <br />&lt;cc1:ValidatorCalloutExtender runat=&quot;Server&quot; ID=&quot;PNReqEx&quot; TargetControlID=&quot;PNRegEx&quot; HighlightCssClass=&quot;highlight&quot; /&gt;</span></p>
</p></div>
</p></div>
</p></div>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html">http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2009/11/thishouse-housing-sales-system.html" title="ThisHouse房屋销售系统">ThisHouse房屋销售系统</a></li><li><a href="http://dddspace.com/2009/08/ajaxcontroltoolkit-amendment-in-calendarextender-styles.html" title="AjaxControlToolkit中CalendarExtender样式修正">AjaxControlToolkit中CalendarExtender样式修正</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MemberShip在动软生成器下UserId的问题</title>
		<link>http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html</link>
		<comments>http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html#comments</comments>
		<pubDate>Fri, 23 Oct 2009 13:58:00 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[CodeMatic]]></category>
		<category><![CDATA[MemberShip]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12753</guid>
		<description><![CDATA[背景

这个月的课程设计我抽签是“房屋销售系统”，一个比较简单的类CMS系统。考虑到时间的因素，我放弃了Python in Django，而是选择了我相对熟悉的.NET平台。我使用的主要工具是动软.NET代码生成器(一个很强大的.NET代码生成器)+MemberShip(微软推出的一个Asp.NET的权限系统)。

我之前只是对MemberShip略有耳闻，动软也是用过几次，所以在一个星期内完成这个课程设计还是比较冒险的。呃&#8220;`呵呵，这也比较符合我的风格，总是要学点东西的嘛。

<span class="readmore"><a href="http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html" title="MemberShip在动软生成器下UserId的问题">阅读全文——共1684字</a></span>]]></description>
			<content:encoded><![CDATA[<h2>背景</h2>
<p>这个月的课程设计我抽签是“房屋销售系统”，一个比较简单的类CMS系统。考虑到时间的因素，我放弃了Python in Django，而是选择了我相对熟悉的.NET平台。我使用的主要工具是<a href="http://www.maticsoft.com/" target="_blank">动软.NET代码生成器</a>(一个很强大的.NET代码生成器)+MemberShip(微软推出的一个Asp.NET的权限系统)。</p>
<p>我之前只是对MemberShip略有耳闻，动软也是用过几次，所以在一个星期内完成这个课程设计还是比较冒险的。呃&#8220;`呵呵，这也比较符合我的风格，总是要学点东西的嘛。</p>
<h2>问题</h2>
<p>MemberShip本身是一个很强大的权限管理系统，其中UserId使用的是uniqueidentifier这种值类型，对应到微软提出的一种标示类型GUID(System.GUID)。这是一种类似“9498ea1f-ce4e-4e6d-b636-1bbbe3db9bde”的非字符串。</p>
<p>动软.NET代码生成器会根据建好的数据库生成相应的代码，可以选择三层模式（BLL+DAL+Model+Web），他会自动生成每层代码。一般来说，生成的项目可以编译完成，但是如果在其中存在uniqueidentifier这种类型的表，就会产生错误，无法通过编译，错误“找不到类型或命名空间名称“uniqueidentifier”（是否缺少 using 指令或程序集引用？）”</p>
<p><span id="more-12753"></span></p>
<h2>解决</h2>
<p>资料非常少，否则我就不会写日志了，直接转载了。</p>
<p>参考一些零星的帖子+自己尝试，我把解决方法总结如下。</p>
<p>1.修改Model中uniqueidentifier类型，因为C#中根本不存在这种类型，将相应的变量类型定义为Guid。</p>
<pre><span style="color: #0000ff">private</span> Guid _userid;

<span style="color: #0000ff">public</span> Guid userId
{
	<span style="color: #0000ff">set</span>{ _userid=<span style="color: #0000ff">value</span>;}
	<span style="color: #0000ff">get</span>{<span style="color: #0000ff">return</span> _userid;}
}</pre>
<p>2.修改相应的Guid&lt;-&gt;string之间的转换，这个根据错误列表一一修改即可。</p>
<pre><span style="color: #0000ff">this</span>.lbluserId.Text=model.userId.ToString();<span style="color: #008000">//Guid拥有.ToString()方法</span>
model.userId = <span style="color: #0000ff">new</span> Guid(userId)<span style="color: #008000">//new Guid(string)</span></pre>
<p>3.修改DAL中数据读取/写入部分，其实这一部分还是Guid&lt;-&gt;string转换</p>
<pre><span style="color: #008000">//model.userId=ds.Tables[0].Rows[0]["userId"].ToString();</span>
<span style="color: #008000">//原始的加上了注释</span>
model.userId=<span style="color: #0000ff">new</span> Guid(ds.Tables[0].Rows[0]["<span style="color: #8b0000">userId</span>"].ToString());
<span style="color: #008000">//使用new Guid(string)进行转换</span></pre>
<p>经过上面3个部分，代码应该基本没有问题了，其实关键的还是Guid&lt;-&gt;string转换，跟着错误列表走一边就基本没有问题了。</p>
<h2>新的问题</h2>
<p>发现用动软生成的Web层中的Add.aspx文件中，如果相对应数据库表有DataTime字段，就会运行时错误“基类包括字段“txtdatetime”，但其类型(System.Web.UI.WebControls.TextBox)与控件(System.Web.UI.HtmlControls.HtmlInputText)的类型不兼容。”。</p>
<p>我将&lt;INPUT &gt;中id修改后，能够运行Add.aspx，但是还是无法post提交，我正在尝试解决这个问题。这个问题与MemberShip无关，放在这里只是希望如果有过客了解Asp.NET，那么就提出一些建议。</p>
<h2>相关链接</h2>
<p>GUID_百度百科：<a href="http://baike.baidu.com/view/185358.htm">http://baike.baidu.com/view/185358.htm</a></p>
<p>SQL中的uniqueidentifier类型在c#中用什么类型表示：<a title="http://topic.csdn.net/t/20060918/17/5030341.html" href="http://topic.csdn.net/t/20060918/17/5030341.html">http://topic.csdn.net/t/20060918/17/5030341.html</a></p>
<p>关于ASP.NET中C#处理uniqueidentifier数据类型的问题：<a title="http://topic.csdn.net/u/20070517/17/9744a192-a062-4c51-bdf7-273b1480c1d6.html" href="http://topic.csdn.net/u/20070517/17/9744a192-a062-4c51-bdf7-273b1480c1d6.html">http://topic.csdn.net/u/20070517/17/9744a192-a062-4c51-bdf7-273b1480c1d6.html</a>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html">http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2009/11/membership-the-use-of-experience.html" title="MemberShip使用心得">MemberShip使用心得</a></li><li><a href="http://dddspace.com/2009/11/thishouse-housing-sales-system.html" title="ThisHouse房屋销售系统">ThisHouse房屋销售系统</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2009/10/membership-moving-soft-issue-of-builder-under-the-userid.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery图片圈人功能在ASP.NET下的改进</title>
		<link>http://dddspace.com/2009/09/jquery-to-achieve-the-school-network-image-circle-of-people-function-results.html</link>
		<comments>http://dddspace.com/2009/09/jquery-to-achieve-the-school-network-image-circle-of-people-function-results.html#comments</comments>
		<pubDate>Wed, 02 Sep 2009 01:11:43 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[Web前端]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[人人]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12622</guid>
		<description><![CDATA[项目中需要一个类似于校内圈人效果的js控件，找了一下基本没有直接能用的，只有一些未完成，我只能自己动手了。  基本框架参照这篇文章《JS实现校内网&#34;图片圈人&#34;功能效果》（强烈推荐这篇文章，这段代码写的很帅气）  我把代码摘录如下，不过还是建议大家去看原文的一些分析。

原始Code:

运行环境：  1.jQuery支持  2.DragResize类（czy1121作者写的一个js类，更多信息可以参照《Javascript Resize和Drag类,基于jQuery》）

<span class="readmore"><a href="http://dddspace.com/2009/09/jquery-to-achieve-the-school-network-image-circle-of-people-function-results.html" title="jQuery图片圈人功能在ASP.NET下的改进">阅读全文——共8222字</a></span>]]></description>
			<content:encoded><![CDATA[<p>项目中需要一个类似于校内圈人效果的js控件，找了一下基本没有直接能用的，只有一些未完成，我只能自己动手了。  基本框架参照这篇文章《<a href="http://www.cnblogs.com/czy1121/archive/2009/03/03/1402105.html">JS实现校内网&quot;图片圈人&quot;功能效果</a>》（强烈推荐这篇文章，这段代码写的很帅气）  我把代码摘录如下，不过还是建议大家去看原文的一些分析。</p>
<h2 style="text-align: center;">原始Code:</h2>
<p>运行环境：  1.jQuery支持  2.DragResize类（czy1121作者写的一个js类，更多信息可以参照《<a href="http://www.cnblogs.com/czy1121/archive/2009/02/26/1398971.html">Javascript Resize和Drag类,基于jQuery</a>》）</p>
<h3>样式：</h3>
<p><span id="more-12622"></span></p>
<pre lang="css">
#enclose-wrapper {
	position: relative;
	z-index: 0;
	border: 4px solid #DDD;
	background-color: #FFF;
}
#form-add-tag {
	margin-left: 8px;
	position: absolute;
	padding: 5px 3px;
	border: 1px solid #005EAC;
	float: left;
	display: inline;
	background-color: #FFF;
}
#select-area-box {
	position: absolute;
	border: 5px solid #D8DFEA;
	float: left;
}
#select-area {
	position: relative;
	padding: 0;
	border: 2px solid #005EAC;
	z-index: 15;
	cursor: move;
	background: url(spacer.gif) no-repeat -1px -1px;
}
#select-area-box span {
	position: absolute;
	border: 1px solid #005EAC;
	width: 8px;
	height: 8px;
	background-color: #FFF;
	font-size: 0;
	z-index: 18;
}
#select-area-box span.north-west-resize {
	cursor: nw-resize;
	left: 0;
	top: 0;
	margin-left: -1px;
	margin-top: -1px;
}
#select-area-box span.north-east-resize {
	cursor: ne-resize;
	right: 0;
	top: 0;
	margin-right: -1px;
	margin-top: -1px;
}
#select-area-box span.south-west-resize {
	cursor: sw-resize;
	left: 0;
	bottom: 0;
	margin-left: -1px;
	margin-bottom: -1px;
}
#select-area-box span.south-east-resize {
	cursor: se-resize;
	right: 0;
	bottom: 0;
	margin-right: -1px;
	margin-bottom: -1px;
}
#enclose-wrapper ul#tag-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
	float: left;
}
#enclose-wrapper ul#tag-list li {
	list-style: none;
	float: left;
}
#enclose-wrapper ul#tag-list li a {
	color: #F60;
}
</pre>
<h3>js实现代码：</h3>
<pre lang="javascript">
var photoTag = {
    show: function(left, top, width, height, show_resize_square) {
        $('#select-area-box').css({
            'left': left - 7,
            'top': top - 7
        })
        $('#select-area-box').width(width + 4).height(height + 4).show();
        $('#select-area').width(width).height(height);
        if (show_resize_square) $('#select-area-box span').show();
        else $('#select-area-box span').hide();
    },
    hide: function() {
        $('#select-area-box').hide();
    },
    add: function(tag_name, tag_value, left, top, width, height) {
        var json = {
            id: Math.floor(Math.random() * 10000)
        };
        var args = left + ',' + top + ',' + width + ',' + height;
        var li = '
<ul>
<li>';         li += '';         li += '(<a href="javascript:;" onclick="photoTag.remove(' + json.id + ',this.parentNode);" li="" args="" onmouseout="photoTag.hide();">删除</a>)';         li += '
<input type="hidden" name="photoField" value="' + tag_name + ':' + tag_value + ',x:' + left + ',y:' + top + ',width:' + width + ',height:' + height + '" />';         li += '</li>
</ul>

';
        $('#tag-list').append(li);
    },
    remove: function(id, li) {
        li.parentNode.removeChild(li);
    }
};
$(function() {
    var is_started = false;
    // 选区左上角,和高宽
    var info = {
        'left': 0,
        'top': 0,
        'width': 0,
        'height': 0
    };
    var origin = {
        x: $('#enclose-wrapper').offset().left + (parseInt($('#enclose-wrapper').css('border-left-width')) || 0),
        y: $('#enclose-wrapper').offset().top + (parseInt($('#enclose-wrapper').css('border-top-width')) || 0)
    };
    var dnr = new DragResize($('#select-area-box')[0], {
        minWidth: 20,
        minHeight: 20,
        bound: {
            left: 0,
            top: 0,
            right: 9999,
            bottom: 9999
        },
        callback: function(i) {
            // 7为左(上)边两个边框的宽度的和, 4为左右(上下)篮色边框宽度的和
            info = {
                'left': i.left + 7,
                'top': i.top + 7,
                'width': i.width - 4,
                'height': i.height - 4
            };
            $('#select-area').width(info.width).height(info.height);
            // 将添加标签的表单定位在选区的右边
            $('#form-add-tag').css({
                'left': i.left + i.width + 10,
                'top': i.top
            });
        }
    });
    // 拖动选区
    $('#select-area').mousedown(function(e) {
        dnr.drag(e);
    });
    // 调整选区大小
    $('#select-area-box span').mousedown(function(e) {
        dnr.resize(e, this.className.replace('-resize', ''));
    });
    // 在图片上点击一下,开始获取选区
    $('#photo-wrapper img').mousedown(function(e) {
        if (is_started) return;
        is_started = true;
        var left = e.pageX - origin.x - 50 - 7;
        var top = e.pageY - origin.y - 50 - 7;
        info = {
            'left': left + 7,
            'top': top + 7,
            'width': 100,
            'height': 100
        };
        photoTag.show(info.left, info.top, info.width, info.height, true);
        $('#form-add-tag').show().css({
            'left': left + 100 + 4 + 10,
            'top': top
        });
    });
    // 鼠标进入图片内时,显示选区
    $('#photo-wrapper img').bind('mouseenter',
    function(e) {
        if (!is_started) return;
        photoTag.show(info.left, info.top, info.width, info.height, true);
    });
    // 确定添加一个标签,或取消
    $('#btn-add-tag, #btn-cancel').click(function(e) {
        if (this.id == 'btn-cancel') {
            $('#form-add-tag, #select-area-box').hide();
            is_started = false;
            return false;
        }
        if (!$('#tag-name').val()) {
            alert('标签名不能为空！');
            return false;
        }
        // 添加标签
        photoTag.add($('#tag-name').val(), $('#tag-value').val(), info.left, info.top, info.width, info.height);
        // 隐藏选区和表单
        $('#form-add-tag, #select-area-box').hide();
        is_started = false;
    });
    photoTag.hide();
});</pre>
<h3>Html代码</h3>
<pre lang="html">
&lt;div id=&quot;enclose-wrapper&quot;&gt;
  &lt;div id=&quot;photo-wrapper&quot; style=&quot;margin:15px auto;text-align:center;&quot;&gt; &lt;img id=&quot;photo&quot; src=&quot;heroes_s3_peter.jpg&quot; /&gt; &lt;/div&gt;
  &lt;div&gt;
    &lt;ul id=&quot;tag-list&quot;&gt;
      &lt;li&gt;相片中：&lt;/li&gt;
      &lt;li&gt; &lt;span onmouseover=&quot;photoTag.show(0,0,85,66);&quot; onmouseout=&quot;photoTag.hide();&quot;&gt;aaa&lt;/span&gt; (&lt;a href=&quot;javascript:;&quot; onclick=&quot;photoTag.remove('342',this.parentNode);&quot; onmouseover=&quot;photoTag.show(0,0,85,66);&quot; onmouseout=&quot;photoTag.hide();&quot;&gt;删除&lt;/a&gt;) &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div id=&quot;select-area-box&quot;&gt;
    &lt;div id=&quot;select-area&quot;&gt;&lt;/div&gt;
    &lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt; &lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt; &lt;/div&gt;
  &lt;div id=&quot;form-add-tag&quot; style=&quot;display:none;&quot;&gt; 输入标签：

    &lt;input id=&quot;tag-name&quot; name=&quot;tag-name&quot; type=&quot;text&quot;  /&gt;

    &lt;button id=&quot;btn-add-tag&quot; type=&quot;button&quot;&gt;确认&lt;/button&gt;
    &lt;button id=&quot;btn-cancel&quot; type=&quot;button&quot;&gt;取消&lt;/button&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<h2 style="text-align: center;">改进</h2>
<p>在Asp.NET下这段代码存在几个问题（毕竟这段代码应该只能算是Demo）：1.无法和服务器进行数据交互。2.无法在ASP.NET环境下获取相关id。3.只能提交到服务器一个&ldquo;标签&rdquo;，不足以完成需求。</p>
<h3>修改后js:</h3>
<pre lang="javascript">
var photoTag = {
    show: function(left, top, width, height, show_resize_square) {
        $('#select-area-box').css({
            'left': left - 7,
            'top': top - 7
        })
        $('#select-area-box').width(width + 4).height(height + 4).show();
        $('#select-area').width(width).height(height);
        if (show_resize_square) $('#select-area-box span').show();
        else $('#select-area-box span').hide();
    },
    hide: function() {
        $('#select-area-box').hide();
    },
    add: function(tag_name, tag_value, left, top, width, height) {
        var json = {
            id: Math.floor(Math.random() * 10000)
        };
        //$.getJSON('add_tag.php', {'name':tag_name,'left':left,'top':top,'width':width,'height':height}, function(json) {
        //reflesh tag list
        //    if(json.message) alert(json.message);
        //    if(json.error == 0) {
        var args = left + ',' + top + ',' + width + ',' + height;
        var li = '
<ul>
<li>';         li += '';         li += '(<a onmouseout="photoTag.hide();" args="" li="" onclick="photoTag.remove(' + json.id + ',this.parentNode);" href="javascript:;">删除</a>)';         li += '
<input type="hidden" value="' + tag_name + ':' + tag_value + ',x:' + left + ',y:' + top + ',width:' + width + ',height:' + height + '" name="photoField" />';         li += '</li>
</ul>

';
        $('#tag-list').append(li);
        //    }
        //});
    },
    remove: function(id, li) {
        //$.getJSON('remove_tag.php', {'tag_id':id}, function(json) {
        //reflesh tag list
        //    if(json.message) alert(json.message);
        //    if(json.error == 0)
        li.parentNode.removeChild(li);
        //});
    }
};
$(function() {
    var is_started = false;
    // 选区左上角,和高宽
    var info = {
        'left': 0,
        'top': 0,
        'width': 0,
        'height': 0
    };
    var origin = {
        x: $('#enclose-wrapper').offset().left + (parseInt($('#enclose-wrapper').css('border-left-width')) || 0),
        y: $('#enclose-wrapper').offset().top + (parseInt($('#enclose-wrapper').css('border-top-width')) || 0)
    };
    var dnr = new DragResize($('#select-area-box')[0], {
        minWidth: 20,
        minHeight: 20,
        bound: {
            left: 0,
            top: 0,
            right: 9999,
            bottom: 9999
        },
        callback: function(i) {
            // 7为左(上)边两个边框的宽度的和, 4为左右(上下)篮色边框宽度的和
            info = {
                'left': i.left + 7,
                'top': i.top + 7,
                'width': i.width - 4,
                'height': i.height - 4
            };
            $('#select-area').width(info.width).height(info.height);
            // 将添加标签的表单定位在选区的右边
            $('#form-add-tag').css({
                'left': i.left + i.width + 10,
                'top': i.top
            });
        }
    });
    // 拖动选区
    $('#select-area').mousedown(function(e) {
        dnr.drag(e);
    });
    // 调整选区大小
    $('#select-area-box span').mousedown(function(e) {
        dnr.resize(e, this.className.replace('-resize', ''));
    });
    // 在图片上点击一下,开始获取选区
    $('#photo-wrapper img').mousedown(function(e) {
        if (is_started) return;
        is_started = true;
        var left = e.pageX - origin.x - 50 - 7;
        var top = e.pageY - origin.y - 50 - 7;
        info = {
            'left': left + 7,
            'top': top + 7,
            'width': 100,
            'height': 100
        };
        photoTag.show(info.left, info.top, info.width, info.height, true);
        $('#form-add-tag').show().css({
            'left': left + 100 + 4 + 10,
            'top': top
        });
    });
    // 鼠标进入图片内时,显示选区
    $('#photo-wrapper img').bind('mouseenter',
    function(e) {
        if (!is_started) return;
        photoTag.show(info.left, info.top, info.width, info.height, true);
    });
    // 确定添加一个标签,或取消
    $('#btn-add-tag, #btn-cancel').click(function(e) {
        if (this.id == 'btn-cancel') {
            $('#form-add-tag, #select-area-box').hide();
            is_started = false;
            return false;
        }
        if (!$('#tag-name').val()) {
            alert('标签名不能为空！');
            return false;
        }
        // 添加标签
        photoTag.add($('#tag-name').val(), $('#tag-value').val(), info.left, info.top, info.width, info.height);
        // 隐藏选区和表单
        $('#form-add-tag, #select-area-box').hide();
        is_started = false;
    });
    photoTag.hide();
});</pre>
<h3>Html代码：</h3>
<pre lang="html">
&lt;div id=&quot;enclose-wrapper&quot;&gt;
  &lt;div id=&quot;photo-wrapper&quot;&gt;
    &lt;asp:Image ID=&quot;ImgPhoto&quot; Visible=&quot;false&quot; runat=&quot;server&quot; /&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;ul id=&quot;tag-list&quot;&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div id=&quot;select-area-box&quot;&gt;
    &lt;div id=&quot;select-area&quot;&gt; &lt;/div&gt;
    &lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt; &lt;/div&gt;
  &lt;div id=&quot;form-add-tag&quot; style=&quot;display: none;&quot;&gt; 名称：
    &lt;input id=&quot;tag-name&quot; name=&quot;tag-name&quot; type=&quot;text&quot; /&gt;

    数值：
    &lt;input id=&quot;tag-value&quot; name=&quot;tag-value&quot; type=&quot;text&quot; /&gt;

    &lt;button id=&quot;btn-add-tag&quot; type=&quot;button&quot;&gt; 确认&lt;/button&gt;
    &lt;button id=&quot;btn-cancel&quot; type=&quot;button&quot;&gt; 取消&lt;/button&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>这边的主要修改在于把框子的右边的内容增加为名称和数值，方便数据的识别。</p>
<h3>后台ASP.NET文件读取</h3>
<pre lang="c#">
string[] fields = Request.Params.GetValues(&quot;photoField&quot;);</pre>
<p>这里呢，由于上传的元素<code>name</code>相同，都是<code>photoField</code>，所以通过<code>Params.GetValues()</code>就可以取出<code>string</code>数组，这样就能获取所有数据了。数据格式是&quot;<code>ddl:小楠,x:98.88333129882812,y:146,width:100,height:100</code>&quot;这种形式，依靠&quot;,&quot;分割。</p>
<h3>相关下载</h3>
<p><a href="http://dddspace.com/wp-content/uploads/2009/09/DragResize.js">DragResize.js</a>  <a href="http://dddspace.com/wp-content/uploads/2009/09/template.js">template.js</a>  <a href="http://dddspace.com/wp-content/uploads/2009/09/css.css">css.css</a></p>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2009/09/jquery-to-achieve-the-school-network-image-circle-of-people-function-results.html">http://dddspace.com/2009/09/jquery-to-achieve-the-school-network-image-circle-of-people-function-results.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2010/08/azaajaxchat-notes-implementation.html" title="AzaAjaxChat笔记-实现">AzaAjaxChat笔记-实现</a></li><li><a href="http://dddspace.com/2010/06/ie-xml-cache-problem.html" title="IE XML 缓存问题">IE XML 缓存问题</a></li><li><a href="http://dddspace.com/2010/05/swfobject.html" title="SWFObject 一款JavaScript的Flash检测与插入模块">SWFObject 一款JavaScript的Flash检测与插入模块</a></li><li><a href="http://dddspace.com/2010/01/development-of-cross-browser-javascript-should-pay-attention-to-the-problem.html" title="开发跨浏览器JavaScript时要注意的问题">开发跨浏览器JavaScript时要注意的问题</a></li><li><a href="http://dddspace.com/2009/10/natter-about-the-school.html" title="数落一下校内">数落一下校内</a></li><li><a href="http://dddspace.com/2009/09/gae-initial-contact-with-the-school-app.html" title="GAE+校内App初接触">GAE+校内App初接触</a></li><li><a href="http://dddspace.com/2009/09/when-google-app-engine-encounter-campus.html" title="当Google APP Engine遇上校内">当Google APP Engine遇上校内</a></li><li><a href="http://dddspace.com/2009/08/the-school-changed-its-name-to-all.html" title="校内更名为人人">校内更名为人人</a></li><li><a href="http://dddspace.com/2009/07/log-into-the-school-network-function.html" title="校内网日志导入功能">校内网日志导入功能</a></li><li><a href="http://dddspace.com/2009/06/xiaoneicaicai-gadget-v0-1.html" title="校内踩踩小工具v0.1">校内踩踩小工具v0.1</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2009/09/jquery-to-achieve-the-school-network-image-circle-of-people-function-results.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>AjaxControlToolkit中CalendarExtender样式修正</title>
		<link>http://dddspace.com/2009/08/ajaxcontroltoolkit-amendment-in-calendarextender-styles.html</link>
		<comments>http://dddspace.com/2009/08/ajaxcontroltoolkit-amendment-in-calendarextender-styles.html#comments</comments>
		<pubDate>Fri, 28 Aug 2009 02:46:03 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[Web前端]]></category>
		<category><![CDATA[AjaxControlToolkit]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12615</guid>
		<description><![CDATA[在The Official Microsoft ASP.NET Site上有一个很强大的控件AJAX Control Toolkit，其功能非常完整，几乎涵盖了表现层方面各种应用，使用也很方便，有中文详细支持，能给程序员很大帮助。

我现在使用的其中一款控件叫做CalendarExtender，其实是一个DatePicker（日期选择器），这个控件可以直接在Input控件上添加“扩展程序”，就完成了所有工作。



<span class="readmore"><a href="http://dddspace.com/2009/08/ajaxcontroltoolkit-amendment-in-calendarextender-styles.html" title="AjaxControlToolkit中CalendarExtender样式修正">阅读全文——共1083字</a></span>]]></description>
			<content:encoded><![CDATA[<p>在<a href="http://www.asp.net">The Official Microsoft ASP.NET Site</a>上有一个很强大的控件<a href="http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27326">AJAX Control Toolkit</a>，其功能非常完整，几乎涵盖了表现层方面各种应用，使用也很方便，有中文详细支持，能给程序员很大帮助。</p>
<p>我现在使用的其中一款控件叫做CalendarExtender，其实是一个DatePicker（日期选择器），这个控件可以直接在Input控件上添加“扩展程序”，就完成了所有工作。</p>
<p><a href="http://dddspace.com/wp-content/uploads/2009/09/0e9aa6590cdc.jpg" class="highslide-image" onclick="return hs.expand(this);"><img style="border: 0pt none; display: block; margin-left: auto; margin-right: auto;" title="偏移" src="http://dddspace.com/wp-content/uploads/2009/09/0e9aa6590cdc.jpg" border="0" alt="偏移" width="232" height="226" /></a></p>
<p><span id="more-12615"></span>让我意外的是，这个控件在我的页面上工作时候样式似乎有些不正常。</p>
<p>页面漂移了！我仔细检查了FireBug，发现下面的样式中的padding影响了其td。(页面可不是我设计的&#8220;`)</p>
<p><a href="http://dddspace.com/wp-content/uploads/2009/09/Firebug.jpg" class="highslide-image" onclick="return hs.expand(this);"><img style="border: 0pt none; display: block; margin-left: auto; margin-right: auto;" title="Firebug" src="http://dddspace.com/wp-content/uploads/2009/09/Firebug.jpg" border="0" alt="Firebug" width="549" height="197" /></a></p>
<p>如果修改CSS，就带来了大量的页面需要修改class/id，所以我只能修正CalendarExtender。（话说人家jQuery在这儿丝毫不受影响，全部元素都覆盖了样式，AJAX Control Toolkit在样式上还是不如jQuery）</p>
<p>我在CalendarExtender外面包了一层div，再覆盖CalendarExtender的td属性。</p>
<p>Html代码：</p>
<pre><span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;</span><span style="color: #c71585">asp</span>:<span style="color: #800000">TextBox</span> <span style="color: #ff0000">ID</span>=<span style="color: #0000ff">"TbBirthday"</span> <span style="color: #ff0000">runat</span>=<span style="color: #0000ff">"server"</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #c71585">asp</span>:<span style="color: #800000">TextBox</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;</span><span style="color: #800000">cc1</span>:<span style="color: #ff0000">CalendarExtender</span> <span style="color: #ff0000">ID</span>=<span style="color: #0000ff">"TbBirthday_CldEx"</span> <span style="color: #ff0000">runat</span>=<span style="color: #0000ff">"server"</span> <span style="color: #ff0000">Enabled</span>=<span style="color: #0000ff">"True"</span> <span style="color: #ff0000">TargetControlID</span>=<span style="color: #0000ff">"TbBirthday"</span> <span style="color: #ff0000">FirstDayOfWeek</span>=<span style="color: #0000ff">"Monday"</span> <span style="color: #ff0000">Format</span>=<span style="color: #0000ff">"yyyy-MM-dd"</span> <span style="color: #ff0000">PopupPosition</span>=<span style="color: #0000ff">"BottomRight"</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;/</span><span style="color: #800000">cc1</span>:CalendarExtender<span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span></pre>
<p>CSS代码：</p>
<pre><span style="color: #008000">/*bugs for CalendarExtends*/</span>
.<span style="color: #800000">content</span> .<span style="color: #800000">table</span> .<span style="color: #800000">calendar</span> <span style="color: #800000">td</span> {<span style="color: #008000">/*.calender td 前的类是我网页中的上层元素*/</span>
<span style="color: #ff0000">margin</span>: <span style="color: #0000ff">0px</span>;
<span style="color: #ff0000">padding</span>: <span style="color: #0000ff">0px</span>;
}</pre>
<p>这样一来，就可以解决这个问题了。</p>
<p><a href="http://dddspace.com/wp-content/uploads/2009/09/e249092a13bc.jpg" class="highslide-image" onclick="return hs.expand(this);"><img style="border: 0pt none; display: block; margin-left: auto; margin-right: auto;" title="修正" src="http://dddspace.com/wp-content/uploads/2009/09/e249092a13bc.jpg" border="0" alt="修正" width="243" height="223" /></a></p>
<p>最后，附送一个汉化控件的技巧：其实下载后，已经有语言包在下载包里面，之所以没有启用中文，是因为没有打开ScriptManager的全球化控制，把ScriptManager的EnableScriptGlobalization改为true即可。</p>
<p>Asp.NET代码：</p>
<pre><span style="color: #0000ff">&lt;</span><span style="color: #c71585">asp</span>:<span style="color: #800000">ScriptManager</span> <span style="color: #ff0000">ID</span>=<span style="color: #0000ff">"ScriptManager1"</span> <span style="color: #ff0000">runat</span>=<span style="color: #0000ff">"server"</span> <span style="color: #ff0000">EnableScriptGlobalization</span>=<span style="color: #0000ff">"True"</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;/</span><span style="color: #c71585">asp</span>:<span style="color: #800000">ScriptManager</span><span style="color: #0000ff">&gt;</span></pre>
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2009/08/ajaxcontroltoolkit-amendment-in-calendarextender-styles.html">http://dddspace.com/2009/08/ajaxcontroltoolkit-amendment-in-calendarextender-styles.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2010/03/speaking-of-flower-shop.html" title="flower shop 汉化">flower shop 汉化</a></li><li><a href="http://dddspace.com/2009/11/thishouse-housing-sales-system.html" title="ThisHouse房屋销售系统">ThisHouse房屋销售系统</a></li><li><a href="http://dddspace.com/2009/10/ajaxcontroltoolkit-controls-introduced-reproduced.html" title="AjaxControlToolKit控件介绍[转载]">AjaxControlToolKit控件介绍[转载]</a></li><li><a href="http://dddspace.com/2009/09/inove-changes-under-the-heading-style.html" title="iNove下的heading样式修改">iNove下的heading样式修改</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2009/08/ajaxcontroltoolkit-amendment-in-calendarextender-styles.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>由No photo引起</title>
		<link>http://dddspace.com/2009/08/no-photo-caused-by-the.html</link>
		<comments>http://dddspace.com/2009/08/no-photo-caused-by-the.html#comments</comments>
		<pubDate>Tue, 25 Aug 2009 07:52:29 +0000</pubDate>
		<dc:creator>alswl</dc:creator>
				<category><![CDATA[Microsoft .Net]]></category>
		<category><![CDATA[ASP.net]]></category>

		<guid isPermaLink="false">http://dddspace.com/?p=12614</guid>
		<description><![CDATA[某个系统，检查用户照片，如果发现用户并没有设定照片就返回一张No Photo的图片。

返回数据库的图片代码比较格式化。



<span class="readmore"><a href="http://dddspace.com/2009/08/no-photo-caused-by-the.html" title="由No photo引起">阅读全文——共807字</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.chinaqiugou.com/images/detail_no_pic.gif" class="highslide-image" onclick="return hs.expand(this);"><img class="alignnone" src="http://www.chinaqiugou.com/images/detail_no_pic.gif" alt="" width="270" height="257" /></a></p>
<p>某个系统，检查用户照片，如果发现用户并没有设定照片就返回一张No Photo的图片。</p>
<p>返回数据库的图片代码比较格式化。</p>
<pre lang="csharp">
int Id = Int32.Parse(Request.Params.Get("Id"));<br />
string type = Request.Params.Get("type");<br />
BLL.Student bll = new JznuManager.BLL.Student();<br />
student = new JznuManager.Model.Student();<br />
student = bll.GetModel(Id);<br />
Response.ContentType = "image/jpeg";<br />
Response.Cache.SetCacheability(HttpCacheability.Public);<br />
Response.BufferOutput = false;<br />
//输出图片文件二进制数据<br />
Response.OutputStream.Write(student.entryPhoto, 0, (int)student.entryPhoto.Length);<br />
Response.End();</pre >
<p>而如果返回的图片为空时候，就需要填充原先的图片Img。<span id="more-12614"></span></p>
<p>1.我起初设置了Img的默认背景background，当没有图片出来时候，就可以显示出原先背景，但很快发现这个办法的弊病，如果数据库图片过小则会导致背景图片露出来。</p>
<p>2.我考虑在GetPhoto.aspx这个方法内写入判断，在catch中读取一个本地图片文件，再转化为BitMap，再设置content-type，用Response.OutputStream输出~~~</p>
<p>3.上面这个方法调试了很久，老是参数错误，最后我突然想起来一个方法。</p>
<pre  lang="csharp">
Response.Redirect("./Images/nophot.gif");</pre >
<p>这几句话就能解决上述所有问题。</p>
<p>呃，有时候花费了好久，饶了很多弯的问题，其实好好想想反而会很简单。
<div style="margin-top: 15px; background: none repeat scroll 0pt 0pt rgb(238, 238, 238);">
<p><strong>版权所有 © 2010 转载本站文章请注明：</strong> 转载自<a target="_blank" href="http://dddspace.com/">Log4D</a><br /><strong>原文链接:</strong> <a target="_blank" href="http://dddspace.com/2009/08/no-photo-caused-by-the.html">http://dddspace.com/2009/08/no-photo-caused-by-the.html</a><br />您可以随意地转载本站的文章，但是必须在醒目位置注明来源及本站链接，不可以将本站文章商业化使用，或者修改、转换或者以本作品为基础进行创作。<br />3a1ff193cee606bd1e2ea554a16353ee</p>
</div>
<div  class="related_post_title">相关文章</div><ul class="related_post"><li><a href="http://dddspace.com/2009/11/membership-the-use-of-experience.html" title="MemberShip使用心得">MemberShip使用心得</a></li><li><a href="http://dddspace.com/2009/11/thishouse-housing-sales-system.html" title="ThisHouse房屋销售系统">ThisHouse房屋销售系统</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://dddspace.com/2009/08/no-photo-caused-by-the.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
