Dynamic numeric and null validation for textbox in VB.NET

Unknown | 4:23 AM |

 Dim txt As New TextBox()
                txt.ID = "txt" & i.ToString()
                txt.MaxLength = 6
                txt.Attributes.Add("onblur", "validate(this);")
                Dim ftext As New AjaxControlToolkit.FilteredTextBoxExtender()
                ftext.TargetControlID = txt.ClientID
                ftext.FilterType = AjaxControlToolkit.FilterTypes.Numbers Or AjaxControlToolkit.FilterTypes.Custom
                ftext.ValidChars = "."
                Dim req As New RequiredFieldValidator()
                req.ID = "req" & i.ToString()
                req.ControlToValidate = txt.ClientID
                req.ErrorMessage = "*"
                req.ForeColor = Drawing.Color.Red
                req.Enabled = True
                req.Visible = True
                req.EnableViewState = True
                req.Display = ValidatorDisplay.Dynamic
                req.ValidationGroup = "rej"

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....