Solved

Validation Block

Posted on 2011-03-08
4
202 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
  • 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Programmatically storing deadlock graphs with SQL Server 6 41
VB.NET 1 22
parsing JSON help 1 9
Complex SQL statement in VB.NET 7 15
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

773 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