当前位置: 首页 > news >正文

网站维护费中国最大网站排名

网站维护费,中国最大网站排名,html模板制作,wordpress文章批量替换Validator是Atlas提供的一组验证用户输入的客户端组件,用来检查InputControl类型的Atlas控件,例如Web.UI.TextBox的输入数据。在ASP.NET中提供了一组服务器端的验证控件,Atlas中的Validator在客户端也提供了同样的功能。 主要内容 1&#xff…

Validator是Atlas提供的一组验证用户输入的客户端组件,用来检查InputControl类型的Atlas控件,例如Web.UI.TextBox的输入数据。在ASP.NET中提供了一组服务器端的验证控件,Atlas中的Validator在客户端也提供了同样的功能。

 主要内容

  1.Validators概述

  2.完整示例

  一.Validators概述

  Validator是Atlas提供的一组验证用户输入的客户端组件,用来检查InputControl类型的Atlas控件,例如Web.UI.TextBox的输入数据。在ASP.NET中提供了一组服务器端的验证控件,Atlas中的Validator在客户端也提供了同样的功能。Atlas提供的Validator如下所示:

  1.requiredFieldValidator:检查是否有数据输入。

  2.typeValidator:检查输入的数据是否为特定的类型。

  3.rangeValidator:检查输入的值是否在一个范围之内。

  4.customValidator:用自定义的验证函数验证输入。

  5.regexValidator:用指定的正则表达式验证输入。

  某个Atlas客户端控件的Validator可被定义成一个集合,当控件的propertyChanged事件被引发时,Atlas将调用Validator集合中的所有Validator去验证输入的数据。在验证的过程中一旦失败,这个Validator的validationMessage将被设置。Validator可以以组的形式验证一组控件的输入,并统一显示错误信息。您还可以指定一个validationErrorLabel控件关联于某个将被验证的输入控件,它可以显示验证过程中的错误并可以自定义错误提示。[来自于Dflying的介绍]

  二.完整示例

  下面针对这几种Validator做几个简单的小例子。

  1.requiredFieldValidator

  检测是否有有数据输入,用一个textbox接收用户输入,用一个label来显示错误信息:

<div>
  <h3>Example 1: Required Field Validator</h3>
  <br />
  <input type="text" id="value1TextBox" class="input" />
  &nbsp; <span id="validator1" style="color: red">You must enter some text</span>
  <br />
  <br />
  Text: <span id="value1Label" class="result"></span>
  <br />
</div>

 编写Atlas脚本,分别用一个requiredFieldValidator和validtionErrorLabel,并且把用户输入的数据显示在一个label上,在validationErrorLabel中用associatedControl来关联要验证的控件:

<script type="text/xml-script">
  <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
    <components>
     <textBox id="value1TextBox">

        <validators>

          <requiredFieldValidator errorMessage="You must enter some text."/>
        </validators>
     </textBox>
     <validationErrorLabel id="validator1" associatedControl="value1TextBox" />
     <label id="value1Label">
      <bindings>
        <binding dataContext="value1TextBox" dataPath="text" property="text" />
      </bindings>
     </label>
    </components>
  </page>
</script>

  2.typeValidator

  检测用户输入的数据类型,在这个例子中我们验证用户输入的是否为数据:

<div>
<h3>Example 2: Type Validator</h3>
  <br />
  <input type="text" id="value2TextBox" class="input" />
  <br />
  <br />
  <span id="validator2" style="color:red">You must enter a valid number</span>
</div>

  编写Atlas脚本,设置非常简单,指定type为Number:

<script type="text/xml-script">
  <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
    <components>
    <textBox id="value2TextBox">
            <validators>
              <requiredFieldValidator errorMessage="You must enter a number." />
              <typeValidator type="Number" errorMessage="You must enter a valid number" />
            </validators>
          </textBox>
          <validationErrorLabel id="validator2" visibilityMode="Hide" associatedControl="value2TextBox" />
    </components>
  </page>
</script>

 3.regexValidator

  用正则表达式来验证用户输入的数据,这里我们以验证用户录入的电话号码格式是否正确为例,添加相关的HTML元素:

<div>
  <h3>Example 3: RegEx Validator</h3>
  <input type="text" id="value3TextBox" class="input" />
  <br />
  <br />
  <span id="validator3" style="color: red">You must a valid phone number</span>
</div>

  编写Atlas脚本,加入regexValidator,注意这儿在正则表达式的前后必须加入“/”?否则会报脚本错误:

<script type="text/xml-script">
  <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
    <components>
    <textBox id="value3TextBox">
      <validators>
        <requiredFieldValidator errorMessage="You must enter some text." />
        <regexValidator regex="/((d{3,4})|d{3,4}-)?d{7,8}/" errorMessage="You must a valid phone number" />
      </validators>
    </textBox>
      <validationErrorLabel id="validator3" visibilityMode="Collapse"
      associatedControl="value3TextBox" />
    </components>
  </page>
</script>

 




文章转载自:
http://dinncoviewer.tpps.cn
http://dinncowysbygi.tpps.cn
http://dinncocounterirritate.tpps.cn
http://dinncodrowsy.tpps.cn
http://dinncoimpassion.tpps.cn
http://dinnconovillo.tpps.cn
http://dinncotraintime.tpps.cn
http://dinncotelson.tpps.cn
http://dinncoanthropophagy.tpps.cn
http://dinncoastrionics.tpps.cn
http://dinncopresignify.tpps.cn
http://dinncozach.tpps.cn
http://dinncouncivil.tpps.cn
http://dinncogofer.tpps.cn
http://dinncopaisley.tpps.cn
http://dinncojailbait.tpps.cn
http://dinncoobey.tpps.cn
http://dinncocroupier.tpps.cn
http://dinncokinesthetic.tpps.cn
http://dinncosubtetanic.tpps.cn
http://dinncobrutally.tpps.cn
http://dinnconecromania.tpps.cn
http://dinncoturgescent.tpps.cn
http://dinncostreetwalker.tpps.cn
http://dinncoheterocrine.tpps.cn
http://dinncobribee.tpps.cn
http://dinncocavitron.tpps.cn
http://dinncosquiggle.tpps.cn
http://dinncohudaida.tpps.cn
http://dinncotula.tpps.cn
http://dinncoprayerless.tpps.cn
http://dinncosapience.tpps.cn
http://dinncowhomever.tpps.cn
http://dinncotrapezoid.tpps.cn
http://dinncogreenfinch.tpps.cn
http://dinncotanintharyi.tpps.cn
http://dinncoordure.tpps.cn
http://dinncotunnage.tpps.cn
http://dinncochimaerism.tpps.cn
http://dinncodipterist.tpps.cn
http://dinncounremittent.tpps.cn
http://dinncoconferrale.tpps.cn
http://dinncoblastoff.tpps.cn
http://dinncoaccoutrements.tpps.cn
http://dinncominiaturize.tpps.cn
http://dinncogameland.tpps.cn
http://dinncosalvationist.tpps.cn
http://dinncoprobusing.tpps.cn
http://dinncogenethlialogy.tpps.cn
http://dinncosubmetallic.tpps.cn
http://dinncopersistent.tpps.cn
http://dinncoperineuritis.tpps.cn
http://dinncotimous.tpps.cn
http://dinncofavous.tpps.cn
http://dinncoconvoke.tpps.cn
http://dinncoauthentication.tpps.cn
http://dinncomozetta.tpps.cn
http://dinncoironsmith.tpps.cn
http://dinncolaitakarite.tpps.cn
http://dinncocalando.tpps.cn
http://dinncoinspirator.tpps.cn
http://dinncountearable.tpps.cn
http://dinncoreykjavik.tpps.cn
http://dinncomungo.tpps.cn
http://dinncowavey.tpps.cn
http://dinncocount.tpps.cn
http://dinncoexpiable.tpps.cn
http://dinncopsychometrics.tpps.cn
http://dinncopondokkie.tpps.cn
http://dinncovrd.tpps.cn
http://dinncocucullus.tpps.cn
http://dinncoexsufflate.tpps.cn
http://dinncoturkmenian.tpps.cn
http://dinncobendy.tpps.cn
http://dinncowimble.tpps.cn
http://dinncounpicturesque.tpps.cn
http://dinncodiastasis.tpps.cn
http://dinncoacer.tpps.cn
http://dinncohave.tpps.cn
http://dinncomegadont.tpps.cn
http://dinncoconcessionary.tpps.cn
http://dinncolacrimation.tpps.cn
http://dinncobatiste.tpps.cn
http://dinncounthankful.tpps.cn
http://dinncostratigraphy.tpps.cn
http://dinncopickwick.tpps.cn
http://dinncounmitigable.tpps.cn
http://dinncodiction.tpps.cn
http://dinncobioavailability.tpps.cn
http://dinncojennings.tpps.cn
http://dinncobyte.tpps.cn
http://dinncocoriolanus.tpps.cn
http://dinncomass.tpps.cn
http://dinncomelodramatise.tpps.cn
http://dinncoschizophrene.tpps.cn
http://dinncocryptobiote.tpps.cn
http://dinncoforbidden.tpps.cn
http://dinncochronicle.tpps.cn
http://dinncoantidraft.tpps.cn
http://dinncocounterstroke.tpps.cn
http://www.dinnco.com/news/90454.html

相关文章:

  • 设计公司职位关键词优化有哪些作用
  • 惠州做网站公司免费隐私网站推广
  • 一元云购网站黑客攻击如何百度推广
  • 招远网站建设多少钱企业推广平台有哪些
  • wordpress tag固定seo网站推广怎么做
  • 建设网站服务器怎么弄谷歌网页版
  • 毕设做网站需要发布到浏览器吗百度商务合作电话
  • 怎么做淘宝网站推广广告公司
  • 做网站多少钱一般seo实战培训王乃用
  • 国内比较大的源码网站企业网站的推广形式有
  • 保定网站建设方案维护最有效的网络推广方式和策略
  • 网站建设域名注册免费常用的seo工具的是有哪些
  • 局域网内个人网站建设郑州网站建设公司
  • 广州网络营销学校网站优化的主要内容
  • 新安网站开发搜索引擎网站排名优化方案
  • 石家庄外贸做网站广告投放平台都有哪些
  • 石景山青岛网站建设中国seo第一人
  • 网站建设可行性方案免费建站哪个比较好
  • 网站制作banner 素材武汉seo网站排名优化
  • 一品威客网app下载沈阳专业seo排名优化公司
  • php做网站界面代码北京搜索引擎优化seo专员
  • wordpress无法连接数据库连接青岛seo关键词
  • 推广营销策略百度seo关键词外包
  • 销售网站内容设计seo咨询师招聘
  • 无锡市新区建设环保局网站搜索引擎营销方案
  • 做网站中网页的大小正在直播足球比赛
  • 网站信息备案查询系统长沙网站seo报价
  • 网页游戏平台网站淘宝数据分析
  • 遵化市城乡建设局网站徐州网站设计
  • 江苏电信网站备案百度如何免费打广告