本文整理汇总了C#中System.Web.UI.WebControls.ServerValidateEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ServerValidateEventArgs类的具体用法?C# ServerValidateEventArgs怎么用?C# ServerValidateEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerValidateEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了ServerValidateEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: CustomValidator1_ServerValidate
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
try
{
var connString = ConfigurationManager.ConnectionStrings["CineQuilla"].ConnectionString;
using (SqlConnection connection = new SqlConnection(connString))
{
connection.Open();
using (SqlCommand command = new SqlCommand(null, connection))
{
command.CommandText = @"SELECT 1 FROM clients WHERE id = @id";
SqlParameter idParam = new SqlParameter("@id", SqlDbType.Int);
idParam.Value = args.Value;
command.Parameters.Add(idParam);
var reader = command.ExecuteReader();
if (!reader.HasRows)
args.IsValid = false;
}
}
}
catch (SqlException ex)
{
ErrorLabel.Visible = true;
args.IsValid = false;
}
}
开发者ID:Subv,项目名称:CineQuilla,代码行数:29,代码来源:SellCards.aspx.cs
示例17: validateFile
protected void validateFile(object sender, ServerValidateEventArgs e)
{
if(Path.GetExtension(e.Value) == ".jpg" || Path.GetExtension(e.Value) == ".png" || Path.GetExtension(e.Value) == ".gif")
e.IsValid = true;
else
e.IsValid = false;
}
开发者ID:LukeeThompson,项目名称:CST465,代码行数:7,代码来源:UserProfile.aspx.cs
示例18: ExistenceCustomValidator_ServerValidate
//Validate input service group name
//Add Option - Validate existence of group naem
protected void ExistenceCustomValidator_ServerValidate(object source, ServerValidateEventArgs args)
{
var inputValue = args.Value.ToString();
var icdChapters = from element in _dataContext.IcdChapters
select element.icdChapterName.ToString().ToLower();
foreach (var chapter in icdChapters.ToArray())
{
if (chapter.ToString().ToLower().Equals(inputValue.ToLower()))
{
args.IsValid = true;
return;
}
}
args.IsValid = false;
//int editIndex = MedicalServiceList.EditIndex;
//TextBox textBox = MedicalServiceList.Rows[editIndex].FindControl("EditGroupId") as TextBox;
//var inputStringData = textBox.Text;
//var inputIntData = Convert.ToInt64(inputStringData);
//var idList = from element in _dataContext.MedicalServiceGroups
// select element.medicalServiceGroupId;
//foreach (var id in idList.ToArray())
//{
// if (id == inputIntData)
// {
// args.IsValid = true;
// return;
// }
//}
//args.IsValid = false;
}
开发者ID:henryho1612,项目名称:WebDev-EMMWebsite,代码行数:32,代码来源:icd.aspx.cs
示例19: cvIsActive_ServerValidate
protected void cvIsActive_ServerValidate(object source, ServerValidateEventArgs args)
{
if (chkDone.Checked != true)
args.IsValid = false;
else
args.IsValid = true;
}
开发者ID:mzrokz,项目名称:LssTms,代码行数:7,代码来源:Feedback.aspx.cs
示例20: Automobile_ServerValidate
protected void Automobile_ServerValidate(object sender, ServerValidateEventArgs e)
{
int automobileId;
string automobileIdTxt = e.Value;
bool validAutomobile = Int32.TryParse(automobileIdTxt, out automobileId) && (automobileId >= 0);
e.IsValid = validAutomobile;
}
开发者ID:TelerikAcademy,项目名称:QA-Academy,代码行数:7,代码来源:AddRepairCard.aspx.cs
注:本文中的System.Web.UI.WebControls.ServerValidateEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论