private void TypeVal() { if (this.txtNewQty.Text.Trim().Length > 0) { if (!PubEntAdminManager.ContentNumVal(this.txtNewQty.Text.Trim())) { Response.Redirect("InvalidInput.aspx"); } } }
//Security Check public void SecurityCheck(int CaseNum, object Ctrl) { switch (CaseNum) { case 1: //Hidden Field HiddenField hidField = (HiddenField)Ctrl; if (!PubEntAdminManager.ContentNumVal(hidField.Value)) { Response.Redirect("InvalidInput.aspx"); } break; case 2: //Dropdown DropDownList ddlField = (DropDownList)Ctrl; foreach (ListItem li in ddlField.Items) { if (!PubEntAdminManager.ContentNumVal(li.Value)) { Response.Redirect("InvalidInput.aspx"); } } break; case 3: //Textbox TextBox txtField = (TextBox)Ctrl; txtField.Text = txtField.Text.Trim(); if (!PubEntAdminManager.LenVal(txtField.Text, 500)) { Response.Redirect("InvalidInput.aspx"); } if (PubEntAdminManager.OtherVal(txtField.Text)) { Response.Redirect("InvalidInput.aspx"); } if (PubEntAdminManager.SpecialVal2(txtField.Text)) { Response.Redirect("InvalidInput.aspx"); } break; } }