Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Validation Block

I am using the Microsoft Validation  Block.   I am using the code below to check that the webpage is valid.  But I only want to check this if a user enters a web page.

<Bindable(True)> _
    <RegexValidator("(http://|)(www\.)?([^\.]+)\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))", MessageTemplate:="Please enter a valdi webpage")>
      Public Property WebPage() As String
            Return Me.M_WebPage
        End Get
        Set(ByVal Value As String)
            Me.M_WebPage = Value
        End Set
    End Property

Open in new window

Kevin Robinson
Kevin Robinson
  • 2
1 Solution
So bind this regex to a text field where the user enters a web page address. Then you'll be able to see if the address is valid.
Kevin RobinsonPrivate VB.NET ContractorAuthor Commented:
Sorry I should have worded my question better.   I want to validate the web page ONLY if there is one entered.  I.e  a blank field is also OK.
Kevin RobinsonPrivate VB.NET ContractorAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now