摘要: 这节我们要讲下如何通过控件CustomValidator来校验CheckBoxList,客户端校验代码通过jQuery实现。首先看下界面代码:<form id="form1" runat="server"> <div align="center"> <fieldset style="width: 350px; height: 200px;"> <table border="0" cellpadding="3" cellspacing= 阅读全文
posted @ 2012-01-31 23:00 PyCoder 阅读(709) 评论(0) 推荐(0) 编辑
摘要: 这节主要讲如何用jQuery校验表单时间范围,时间控件用到了jQuery-ui,下载地址:http://jqueryui.com/download,Theme选择Sunny界面代码: <form id="form1" runat="server"> <div align="center"> <fieldset style="width: 400px; height: 150px"> <table border="0" cellpadding=" 阅读全文
posted @ 2012-01-31 22:34 PyCoder 阅读(652) 评论(1) 推荐(0) 编辑
摘要: 这节介绍一个自己写的jQuery文本框字符限制插件,至于如何写插件,我这里就不多讲了,可以查看相关介绍,这里主要介绍下该插件的功能:•可限制最大输入字符长度•可设置字符截取速度•可自定义提示信息文本样式(可以改进自定义文本内容)该插件统计英文字符和中文的长度是一样的。废话少说,这里直接奉上详细插件代码,具体实现细节已经在代码里面有注释:; (function ($) { $.fn.extend({ textAreaCount: function (options) { var $textArea = th... 阅读全文
posted @ 2012-01-30 22:22 PyCoder 阅读(878) 评论(0) 推荐(0) 编辑
摘要: 在这节我们将使用validation插件实现注册页面的验证功能,通过这个例子,可以更全面的掌握该插件的使用功能。页面样式代码: <style type="text/css"> .header { background-color: #CCCCCC; color: White; font-size: x-large; } .content { background-color: White; font-weight: ... 阅读全文
posted @ 2012-01-29 23:01 PyCoder 阅读(799) 评论(1) 推荐(0) 编辑
摘要: 从这节开始,我们开始学习如何在ASP.NET控件中使用jQuery validation 插件,首先要用它,必须先了解它有什么用。简单来说,jQuery validation插件就是来校验表单form里面元素输入的内容是否满足业务规则,如果不满足,可以给出用户自定义的提示信息。该插件不仅默认有一些校验规则,如校验内容是否为空,内容的长度是否符合给定的值,还可以根据用户自定义业务规则,而且错误提示信息,也可以根据用户的要求自定义显示。看来这个插件的功能确实很强大,是不是迫不及待想使用了。好的,那我们就开始简介如何使用它。jQuery validation 插件下载地址:http://plugin 阅读全文
posted @ 2012-01-19 00:05 PyCoder 阅读(1254) 评论(2) 推荐(1) 编辑
摘要: 这节我们来看下如何实现通过选择RadioButtonList值动态改变hyperlink控件的URL值,并简要介绍bind和live方法的区别。1.先准备界面代码:<form id="form1" runat="server"> <div align="left"> <fieldset style="width: 300px; height: 200px;"> <table cellpadding="0" cellspacing="0" 阅读全文
posted @ 2012-01-16 22:43 PyCoder 阅读(868) 评论(0) 推荐(1) 编辑
摘要: 要实现该效果,首先要先了解以下几点基础知识:窗体滚动事件:$(window).scroll(function(){...});获取窗体滚动距离:$(window).scrollTop();获取窗体高度:$(window).height();了解以上内容就可以实现通过hyperlink控件实现返回顶部的效果了。1.准备界面结构代码: 1 <form id="form1" runat="server"> 2 <div> 3 <asp:HyperLink ID="Top" runat="server& 阅读全文
posted @ 2012-01-15 23:51 PyCoder 阅读(807) 评论(0) 推荐(0) 编辑
摘要: 在web应用里,我们经常需要通过其他控件的事件触发动态构造DropDownList数据内容。在这节中,我们将会看到如何实现通过选择第一个下来框的内容来动态构造第二个下拉框的内容。首先准备好页面代码:View Code <form id="form1" runat="server"> <div align="left"> <fieldset style="width: 350px; height: 150px"> <p> 选择颜色</p> <table 阅读全文
posted @ 2012-01-14 19:23 PyCoder 阅读(1125) 评论(1) 推荐(0) 编辑
摘要: 这节我们将通过jQuery来获取DropDownList的Text/Value属性值。界面代码:<form id="form1" runat="server"> <div align="center"> <fieldset style="width: 400px; height: 80px;"> <p> 选择颜色:</p> <asp:DropDownList ID="ddlColor" runat="server&quo 阅读全文
posted @ 2012-01-14 17:45 PyCoder 阅读(3383) 评论(0) 推荐(0) 编辑
摘要: 这章内容比较简单,直接上页面代码:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Recipe6.aspx.cs" Inherits="Recipe6" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" 阅读全文
posted @ 2012-01-12 21:27 PyCoder 阅读(754) 评论(1) 推荐(0) 编辑