Inline Validation As Popup

2 posts, 1 answers
  1. Amitkumar
    Amitkumar avatar
    66 posts
    Member since:
    Aug 2009

    Posted 05 Jan 2010 Link to this post

      RequiredFieldValidator validator = new RequiredFieldValidator();
                    editor.TextBoxControl.ID = "GridTextBoxRoleName";
                    validator.ControlToValidate = editor.TextBoxControl.ID;
                    validator.ErrorMessage = "Enter Role Name";
                    validator.SetFocusOnError = true;

    but i want to popup insted of writing in inline how can i do i m writing this code in grid1_ItemCreated(object sender, GridItemEventArgs e)

    thank you
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Jan 2010 Link to this post

    Hello Amit,

    You can add a validationsummary control and pop up the error message. Check out the following code to get this done:
                RequiredFieldValidator validator = new RequiredFieldValidator(); 
                editor.TextBoxControl.ID = "GridTextBoxRoleName"
                validator.ControlToValidate = editor.TextBoxControl.ID; 
                validator.ErrorMessage = "Enter Role Name"
                validator.SetFocusOnError = true
                validator.Display = ValidatorDisplay.None; 
                ValidationSummary validationsum = new ValidationSummary(); 
                validationsum.ID = "ValidationSummary1"
                validationsum.ShowMessageBox = true
                validationsum.ShowSummary = false
                validationsum.DisplayMode = ValidationSummaryDisplayMode.SingleParagraph; 

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top