zoukankan      html  css  js  c++  java
  • net5:自定义验证控件服务器端验证与客户端验证的使用

    原文发布时间为:2008-07-29 —— 来源于本人的百度文章 [由搬家工具导入]

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class Default4 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

        }

        protected void Button1_Click1(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Label1.Text = "pass";
            }
            else
            {
                Label1.Text = "fail";
            }

        }
        protected void txtvlue(object source, ServerValidateEventArgs args)
        {
            if (args.Value == "服务端")
            {
                args.IsValid = true;
            }
            else
            {
                args.IsValid = false;
            }
        }
       }

    --------------------------------------

    <head runat="server">
        <title>无标题页</title>
        <script type="text/javascript">
        function txtvalue(s,e)
        {
           if(e.Value=="客户端")
           {
          
           e.IsValid=true;
           }
           else
           {
           e.IsValid=false;
           }
           }
        </script>
    </head>
    <body>

  • 相关阅读:
    unity c# 获取系统时间
    如果你想让继承MonoBehaviour的类变成Singleten
    关于程序员
    开始养成记录的习惯吧
    关于结构体的赋值问题
    数学中的集合,群,环,域
    励志
    [编程题] 进制均值
    javaEE 入门
    jsp内置对象2
  • 原文地址:https://www.cnblogs.com/handboy/p/7141557.html
Copyright © 2011-2022 走看看