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. Causes validation.

Causes validation.

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptsysadminregexhelp
1 Posts 1 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.
  • M Offline
    M Offline
    MY1201
    wrote on last edited by
    #1

    Hello all! Happy new year! :-) I have a problem with a bizarre ImageButton. It keeps "causing validation". It is part of a table and I use the following code to create it (C#):

    ImageButton cmdDelete = new ImageButton();
    cmdDelete.CommandName = "Delete";
    cmdDelete.CommandArgument = p.DbId.ToString();
    cmdDelete.Command += DeleteRecipient;
    cmdDelete.ImageUrl = "~/Images/trash.gif";
    cmdDelete.CausesValidation = false;
    cmdDelete.OnClientClick = "javascript:Page_ValidationActive=false;";

    1. Causes validation is false. 2. OnClientClick is set to "Page_ValidationActive=false" - which I've heard should be equal to 1., just for the client. Now it behaves like this: The first time it is clicked, it does not cause validation, and the user is deleted and removed from the list. If I click to delete another user, suddenly the button causes validation. If I click it again, it does not! And so on, and so on. I've tried stepping through the code, and every second time the button is clicked, it causes validation. Validation occurs server side, since I've tried turning off JavaScript, and the exact same pattern occurs. I'm kind of confused! LOL! :-) Best regards Soeren

    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