示例#1
0
 private void TypeVal()
 {
     if (this.txtNewQty.Text.Trim().Length > 0)
     {
         if (!PubEntAdminManager.ContentNumVal(this.txtNewQty.Text.Trim()))
         {
             Response.Redirect("InvalidInput.aspx");
         }
     }
 }
示例#2
0
        //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;
            }
        }