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. validation controls [modified]

validation controls [modified]

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
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.
  • S Offline
    S Offline
    sritha
    wrote on last edited by
    #1

    i have designed registration form. in that i used a calender for date of birth and date of join . just i drag and dropped the calender and textbox for date of birth.means whatever the date i have choosen in that calender it must appear over the textbox.here my constraint is doj must be greater than date of birth. for this i need validation controls and validation expressions without javascript if iused the code given by u then it is raising the validation even i gave the date of join greater than date of birth.help me in this regard as soon as possible please help me in this regard

    modified on Saturday, May 9, 2009 1:10 AM

    V R 2 Replies Last reply
    0
    • S sritha

      i have designed registration form. in that i used a calender for date of birth and date of join . just i drag and dropped the calender and textbox for date of birth.means whatever the date i have choosen in that calender it must appear over the textbox.here my constraint is doj must be greater than date of birth. for this i need validation controls and validation expressions without javascript if iused the code given by u then it is raising the validation even i gave the date of join greater than date of birth.help me in this regard as soon as possible please help me in this regard

      modified on Saturday, May 9, 2009 1:10 AM

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      Good Afternoon sritha This can be done in the Following way. On the SelectionChanged event of your calender control enter the following code

      protected void Calendar2_SelectionChanged(object sender, EventArgs e)
      {
      ** txtdateofjoin.Text =Calendar1.SelectedDate.ToShortDateString();**
      }
      protected void Calendar1_SelectionChanged1(object sender, EventArgs e)
      {
      txtdateofbirth.Text = Calendar1.SelectedDate.ToShortDateString();
      }

      This is for diffent textboxes and drop a "CompareValidator" control from the Validation section of your toolbox and right clikc on it and go to Properties. Please Change the Properties to be exactly as i will show you now Control To Compare: -->txtdateofbirth Control To Validate:-->txtdateofjoin Error Message:-->Date of Join must be Greater than Date of birth Operator:-->GreaterThan Well to Test this i had to attempt a postback, so i but a button and never wrote any code for it, and i ran my page and input the dates so that the date of join is equal to the date of birth and i got that Error message in the Error message Property. This is how we do it in Asp.net without using any javascript. Kind Regards Vuyiswa Maseko

      Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

      1 Reply Last reply
      0
      • S sritha

        i have designed registration form. in that i used a calender for date of birth and date of join . just i drag and dropped the calender and textbox for date of birth.means whatever the date i have choosen in that calender it must appear over the textbox.here my constraint is doj must be greater than date of birth. for this i need validation controls and validation expressions without javascript if iused the code given by u then it is raising the validation even i gave the date of join greater than date of birth.help me in this regard as soon as possible please help me in this regard

        modified on Saturday, May 9, 2009 1:10 AM

        R Offline
        R Offline
        RyanMorris
        wrote on last edited by
        #3

        Hi Sritha, You could use a custom validator to do this, this might help[^].

        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