Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. .Net Validation Methods

.Net Validation Methods

Scheduled Pinned Locked Moved Visual Basic
questioncsharp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lasitha Kodikara
    wrote on last edited by
    #1

    I am a newbie for VB.Net. i am trying to validate a textbox (only to put integers or strings). How Can I do That? Lasitha Kodikara lasithak5@sltnet.lk

    H M 2 Replies Last reply
    0
    • L Lasitha Kodikara

      I am a newbie for VB.Net. i am trying to validate a textbox (only to put integers or strings). How Can I do That? Lasitha Kodikara lasithak5@sltnet.lk

      H Offline
      H Offline
      HimaBindu Vejella
      wrote on last edited by
      #2

      U can use Validation Controls Use Regular Expression Validator Or else U can go for Javascript/Vb Script "Aim to go where U have never been B4 and Strive to achieve it" http://groups.yahoo.com/subscribe/dotnetforfreshers http://himabinduvejella.blogspot.com

      1 Reply Last reply
      0
      • L Lasitha Kodikara

        I am a newbie for VB.Net. i am trying to validate a textbox (only to put integers or strings). How Can I do That? Lasitha Kodikara lasithak5@sltnet.lk

        M Offline
        M Offline
        machman1
        wrote on last edited by
        #3

        In VS go to the left side drop down, select the text box, right side declarations, choose validating and this is how the code could look like. private Sub txtMiles_ Validationg(byval sender as object, _ by val e as System.ComponetModel.CancelEventArgs)_ Handels txtMiles.Validating Try Dim decMiles as Decimal = Convert.ToDecimal(txtMiles.Text) ErrorProvider1.SetError(txtMiles, ex.Message) Catch ex as Exception ErrorProvider1.Seterror(txtMiles, ex.Message) End Try End Sub If there were no God, there would be no Atheists. :-D

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups