Solved

Validation Block

Posted on 2011-03-08
4
206 Views
Last Modified: 2012-05-11
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
        Get
            Return Me.M_WebPage
        End Get
        Set(ByVal Value As String)
            Me.M_WebPage = Value
        End Set
    End Property

Open in new window

0
Comment
Question by:Kevin Robinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Epitel0920
ID: 35114094
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.
0
 
LVL 3

Author Comment

by:Kevin Robinson
ID: 35126933
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.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 35177089
0
 
LVL 3

Author Closing Comment

by:Kevin Robinson
ID: 35180151
Sweet!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question