當前位置: 首頁>>代碼示例>>C#>>正文


C# WebControls.ServerValidateEventArgs類代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.ServerValidateEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# ServerValidateEventArgs類的具體用法?C# ServerValidateEventArgs怎麽用?C# ServerValidateEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ServerValidateEventArgs類屬於System.Web.UI.WebControls命名空間,在下文中一共展示了ServerValidateEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: IsAvailablePass

        protected void IsAvailablePass(object source, ServerValidateEventArgs args)
        {
            var hashre = new PasswordHasher();

            args.IsValid = (hashre.VerifyHashedPassword(Context.User.Identity.GetUserInfo().PasswordHash, args.Value)) ==
                           PasswordVerificationResult.Success;
        }
開發者ID:rabbal,項目名稱:AspNetWebForms-Forum,代碼行數:7,代碼來源:ChangePass.aspx.cs

示例2: CustomValidator1_ServerValidate

 protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (CheckBoxRegulamin.Checked)
         args.IsValid = true;
     else
         args.IsValid = false;
 }
開發者ID:taksun,項目名稱:ASP,代碼行數:7,代碼來源:Register.aspx.cs

示例3: CustomValidator4_ServerValidate

 protected void CustomValidator4_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (CheckBox1.Checked && TextBox1.Text == "")
     {
         args.IsValid = false;
     }
 }
開發者ID:do-you,項目名稱:web-application-dev,代碼行數:7,代碼來源:buypage2.aspx.cs

示例4: val_email

 public void val_email(object source, ServerValidateEventArgs args)
 {
     Regex rgxEmail = new Regex(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
                    @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
                    @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
     args.IsValid = rgxEmail.IsMatch(args.Value);
 }
開發者ID:Neklussy,項目名稱:Examen,代碼行數:7,代碼來源:add.aspx.cs

示例5: ValidateImage

        private void ValidateImage(object source, ServerValidateEventArgs args)
        {
            if (FileUploadEdit.HasFile)
            {
                var bytes = FileUploadEdit.FileBytes;

                try
                {
                    var image = System.Drawing.Image.FromStream(new MemoryStream(bytes));
                }
                catch
                {
                    // catch any error when user tries to load a file that 
                    // is not an image recognised by System.Drawing
                    args.IsValid = false;
                    CustomValidator1.ErrorMessage = "Not an Image";
                }
            }
            else
            {
                return;
                // no file to download you decide wether this is a valid error
                // to throw comment out
                if (!FileUploadEdit.HasFile && String.IsNullOrEmpty(ImageEdit.ImageUrl))
                {
                    args.IsValid = false;
                    CustomValidator1.ErrorMessage = "No file to download";
                }
            }
        }
開發者ID:jorik041,項目名稱:X.DynamicData,代碼行數:30,代碼來源:FileImage_Edit.ascx.cs

示例6: CvUserName_ServerValidate

 protected void CvUserName_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (args.Value.Length >= 6)
         args.IsValid = true;
     else
         args.IsValid = false;
 }
開發者ID:ananth039,項目名稱:Anantha-Kumar-.net-Practice-programs,代碼行數:7,代碼來源:UserRegisteration.aspx.cs

示例7: cvProcName_ServerValidate

 protected void cvProcName_ServerValidate(object source, ServerValidateEventArgs args)
 {
     //默認不存在該部門
     args.IsValid = false;
     //檢測是否存在部門
     args.IsValid = ydPublicMethod.IsExistProc(args.Value);
 }
開發者ID:yangdan8,項目名稱:ydERPGJ,代碼行數:7,代碼來源:MaterialOutAdd.aspx.cs

示例8: CheckDate

 protected void CheckDate(object sender, ServerValidateEventArgs e)
 {
     DateTime date;
     bool IsDate = DateTime.TryParse(e.Value, out date);
     if (IsDate) e.IsValid = true;
     else e.IsValid = false;
 }
開發者ID:nehawadhwa,項目名稱:ccweb,代碼行數:7,代碼來源:ScattergramsEditUserScores.aspx.cs

示例9: CheckPassword

 protected void CheckPassword(object source, ServerValidateEventArgs args)
 {
     if (WebClient.RevalidatePassword(PasswordField.Text))
         args.IsValid = true;
     else
         args.IsValid = false;
 }
開發者ID:ThePublicTheater,項目名稱:NYSF,代碼行數:7,代碼來源:AccountUpdateForm.ascx.cs

示例10: cvTitle_ServerValidate

 protected void cvTitle_ServerValidate(object source, ServerValidateEventArgs args)
 {
     SqlDataAdapter da = new SqlDataAdapter("", connection);
     DataTable dt = new DataTable();
     DataTable dl = new DataTable();
     da.SelectCommand.CommandText = "SELECT * FROM Skills WHERE ID = @sxid";
     da.SelectCommand.Parameters.AddWithValue("@sxid", Request.QueryString["Sid"]);
     da.Fill(dl);
     //Consept : Check if TextBox' value has changed or not
     //If This part doesn't Exist -> the page won't be valid Because of the next part of Validation. WHY? ...
     //if the title isn't changed the next part cause invalidation beacuse the Title has already Exist
     if (dl.Rows[0]["Title"].ToString() != txtTitle.Text)
     {
         da.SelectCommand.CommandText = "SELECT * FROM Skills WHERE [email protected] AND [email protected]";
         da.SelectCommand.Parameters.AddWithValue("@t", txtTitle.Text);
         da.SelectCommand.Parameters.AddWithValue("@scid", ddlSkillCat.SelectedValue);
         da.Fill(dt);
         //If the TextBox' Value has changed ...
         //So , Now Check if The New Value has already Exist in Table or not
         if (dt.Rows.Count == 0)
         {
             args.IsValid = true;
         }
         else
             args.IsValid = false;
     }
 }
開發者ID:AshkanBehzad,項目名稱:CACTB,代碼行數:27,代碼來源:EditSkills.aspx.cs

示例11: cvCaptcha_ServerValidate

        protected void cvCaptcha_ServerValidate(object source, ServerValidateEventArgs args)
        {
            bool isValid = false;

            if (ViewState["captchaToken"] != null)
            {
                Guid captchaToken = (Guid)ViewState["captchaToken"];
                using (CSSDataContext db = new CSSDataContext())
                {
                    var captcha = db.Captchas.FirstOrDefault(p => p.Id == captchaToken);

                    //args.Value
                    //CustomValidator cvCaptcha = (CustomValidator)source;
                    //TextBox txtValidationCode = (TextBox) cvCaptcha.ControlToValidate;
                    if (captcha != null && args.Value.Equals(captcha.Answer, StringComparison.InvariantCultureIgnoreCase) == true)
                    {
                        isValid = true;
                    }
                }
            }

            if (isValid == false)
                ViewState["captchaToken"] = null;

            args.IsValid = isValid;
        }
開發者ID:LordBlacksun,項目名稱:Allegiance-Community-Security-System,代碼行數:26,代碼來源:CreateUser.aspx.cs

示例12: IsAvailableEmail

 protected void IsAvailableEmail(object source, ServerValidateEventArgs args)
 {
     using (_repository)
     {
         args.IsValid = !_repository.Users.Select(s => s.Email).Contains(this.EmailTexbox.Text);
     }
 }
開發者ID:rabbal,項目名稱:AspNetWebForms-Forum,代碼行數:7,代碼來源:Site.Master.cs

示例13: LogoValidator_ServerValidate

 protected void LogoValidator_ServerValidate(object sender, ServerValidateEventArgs e)
 {
     if (e.Value.Length > 0)
     {
         e.IsValid = FileType.IsImageFile(e.Value);
     }
 }
開發者ID:sigcms,項目名稱:Seeger,代碼行數:7,代碼來源:SiteInfoEdit.aspx.cs

示例14: CustomValidator_ServerValidate

        protected void CustomValidator_ServerValidate(object source, ServerValidateEventArgs args)
        {
            //string imageName = Guid.NewGuid().ToString().Substring(0, 8);
            //string geocacheImageTemp = imageName + ".bmp";
            //System.Drawing.Bitmap bmpPostedImage = new System.Drawing.Bitmap(imageFileUpload.PostedFile.InputStream);
            //bmpPostedImage.Save(Server.MapPath(@"temp\") + imageName + ".bmp");
            ////bmpPostedImage.Save("C:\\Users\\Juliana\\Documents\\GitHub\\ASECPJ\\ASECPJ\\geocache\\temp\\" + imageName + ".bmp");

            //Stegano decryptStegano = new Stegano();
            //string message = decryptStegano.RetrieveMessage(Server.MapPath(@"temp\") + imageName + ".bmp");
            ////string message = decryptStegano.RetrieveMessage("C:\\Users\\Juliana\\Documents\\GitHub\\ASECPJ\\ASECPJ\\geocache\\temp\\3a902149.bmp");

            //if (message.Equals(""))
            //{
            //    Response.Redirect("true");
            //    args.IsValid = true;

            //}
            //else
            //{
            //    Response.Redirect("false");
            //    args.IsValid = false;
            //}

            args.IsValid = true;
        }
開發者ID:hexcone,項目名稱:ASECPJ,代碼行數:26,代碼來源:create.aspx.cs

示例15: CustomValidator1_ServerValidate

 protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (Image1.ImageUrl == "Images/icon_visa.png")
     {
         if ((txtCard.Text).Count() == 16 || (txtCard.Text).Count() == 13)
             args.IsValid = true;
         else
             args.IsValid = false;
     }
     else
         if (Image1.ImageUrl =="Images/apps_mastercard.png")
         {
             if ((txtCard.Text).Count() == 16)
                 args.IsValid = true;
             else
                 args.IsValid = false;
         }
         else
             if (Image1.ImageUrl =="Images/download.jpg")
             {
                 if ((txtCard.Text).Count() == 15)
                     args.IsValid = true;
                 else
                     args.IsValid = false;
             }
             else args.IsValid = false;
 }
開發者ID:shiva94,項目名稱:SelfServiceSales_Full,代碼行數:27,代碼來源:payBillFinal.aspx.cs


注:本文中的System.Web.UI.WebControls.ServerValidateEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。