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. Web Development
  3. ASP.NET
  4. how to use the rangevalidator controll

how to use the rangevalidator controll

Scheduled Pinned Locked Moved ASP.NET
csshelptutorialquestion
5 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.
  • H Offline
    H Offline
    Hasan Jaffal
    wrote on last edited by
    #1

    how to use the rangevalidator control with controls of a grid view i can access controls of a grid view by this way : Dim myControl1 As Control = Me.FormView1.FindControl("zipTextBox") Dim t As TextBox If (Not myControl1 Is Nothing) Then t = myControl1 a.ControlToValidate = "" a.Text = "eror ya hmar" ' Get control's parent. MsgBox(t.Text) Else MsgBox("Control not found.....") End If ao i want to make a rangevalidatot to control the value in the textbox t but the problem is if i say MYrangevalidator.ControlToValidate = t t should be a string ???????

    M M 2 Replies Last reply
    0
    • H Hasan Jaffal

      how to use the rangevalidator control with controls of a grid view i can access controls of a grid view by this way : Dim myControl1 As Control = Me.FormView1.FindControl("zipTextBox") Dim t As TextBox If (Not myControl1 Is Nothing) Then t = myControl1 a.ControlToValidate = "" a.Text = "eror ya hmar" ' Get control's parent. MsgBox(t.Text) Else MsgBox("Control not found.....") End If ao i want to make a rangevalidatot to control the value in the textbox t but the problem is if i say MYrangevalidator.ControlToValidate = t t should be a string ???????

      M Offline
      M Offline
      mnaveed
      wrote on last edited by
      #2

      if you setting the Id of the control "zipTextBox" then you just need to do this MYrangevalidator.ControlToValidate = t.ID; bcz ControlToValidate only need ID(string) of the control you want to validate. Nav.

      H 1 Reply Last reply
      0
      • H Hasan Jaffal

        how to use the rangevalidator control with controls of a grid view i can access controls of a grid view by this way : Dim myControl1 As Control = Me.FormView1.FindControl("zipTextBox") Dim t As TextBox If (Not myControl1 Is Nothing) Then t = myControl1 a.ControlToValidate = "" a.Text = "eror ya hmar" ' Get control's parent. MsgBox(t.Text) Else MsgBox("Control not found.....") End If ao i want to make a rangevalidatot to control the value in the textbox t but the problem is if i say MYrangevalidator.ControlToValidate = t t should be a string ???????

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

        You simply put the RangeValidator in the FormView control as you would with the TextBox, and simply assign the id of the TextBox to the ControlToValidate property of the validator. For more information, see RangeValidator[^]

        H 1 Reply Last reply
        0
        • M mnaveed

          if you setting the Id of the control "zipTextBox" then you just need to do this MYrangevalidator.ControlToValidate = t.ID; bcz ControlToValidate only need ID(string) of the control you want to validate. Nav.

          H Offline
          H Offline
          Hasan Jaffal
          wrote on last edited by
          #4

          thanks i tried it but it does't work too

          1 Reply Last reply
          0
          • M minhpc_bk

            You simply put the RangeValidator in the FormView control as you would with the TextBox, and simply assign the id of the TextBox to the ControlToValidate property of the validator. For more information, see RangeValidator[^]

            H Offline
            H Offline
            Hasan Jaffal
            wrote on last edited by
            #5

            hello thanks it was a good idea and it works thanks

            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