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. Required Field Validators

Required Field Validators

Scheduled Pinned Locked Moved ASP.NET
helpcsharpdatabasesysadmin
4 Posts 2 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.
  • P Offline
    P Offline
    payal sheth
    wrote on last edited by
    #1

    Hello all , I have used Asp .Net Required field validators in my aspx site.The problem is like its firing the validation but after the server operation. Like suppose i m entering some new data and kept null validation.Its firing that validation after the data is saved in the database... Pls can any one help me..... thanks................ :-D

    G P 2 Replies Last reply
    0
    • P payal sheth

      Hello all , I have used Asp .Net Required field validators in my aspx site.The problem is like its firing the validation but after the server operation. Like suppose i m entering some new data and kept null validation.Its firing that validation after the data is saved in the database... Pls can any one help me..... thanks................ :-D

      G Offline
      G Offline
      gnjunge
      wrote on last edited by
      #2

      Did you add the following code before your dbase operation? C# if (page.isValid()) { // your dbase code } VB.NET If page.isValid() Then // your dbase code End if Well I guess the code speaks for itself. Only if the data is valid (passed through the server side validation) it should do some action. Hope this helps. Gidon

      1 Reply Last reply
      0
      • P payal sheth

        Hello all , I have used Asp .Net Required field validators in my aspx site.The problem is like its firing the validation but after the server operation. Like suppose i m entering some new data and kept null validation.Its firing that validation after the data is saved in the database... Pls can any one help me..... thanks................ :-D

        P Offline
        P Offline
        payal sheth
        wrote on last edited by
        #3

        Thanks.... Well i have the problem after i upload my site on server...do i need to deploy WebUIValidation.js, SmartNav.js files on my server in my site folder...if yes let me know the location.... Its working on my developement machine properly....without checking the validity of the page like VB. net page.IsValid() { } thanks once again..... do let me know if u come up some solution for this...... :-D

        G 1 Reply Last reply
        0
        • P payal sheth

          Thanks.... Well i have the problem after i upload my site on server...do i need to deploy WebUIValidation.js, SmartNav.js files on my server in my site folder...if yes let me know the location.... Its working on my developement machine properly....without checking the validity of the page like VB. net page.IsValid() { } thanks once again..... do let me know if u come up some solution for this...... :-D

          G Offline
          G Offline
          gnjunge
          wrote on last edited by
          #4

          If the website is well configured, those files should be there already. Otherwise you have to run the asp.net configuration command for that website (I forgot the details about that). As you know the WebUIValidation.JS file includes all the CLIENTSIDE validation scripts for your asp.net app. So if it is not found it won't be able to validate your page using client side scripting. But one important thing is that this client side validation doesn't work with browsers such as FireFox, ASP.NET falls back on Server side validation for these browsers. And for server side validation you need to provide the code I just gave you. (Check you dev site with Firefox for example and you'll see that you'll get exactly the same problem as with your live site). So plan of action: - Check your dev site with Firefox for example, and see that client validation doesn't work, and server validation is "skipped" (actually it is being executed, but your dbase code will also be executed). - Update your code so it will include page.isValid() before executing any code that depends on a valid form input. - Configure your live site, so that it includes the right client side script files And that's it. Gidon

          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