problem with button ASPX (running javascript) since I have added a control validator.

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default problem with button ASPX (running javascript) since I have added a control validator.

    Hi,

    J'ai un bouton ASPX qui doit déclencher un script java.
    I have an ASPX button running a javascript.

    To do this, I have added in the codebehind :
    this.Btn_Debut.Attributes.Add("onclick","javascrip t:DatePicker('Selection_Ar
    chives','Date_Debut')");

    So far, no problem with this...

    Then, I have added some controls validator. Then the button stop to works.
    If I remove the validator, everythings run ok.

    Can you help me ?

    H. MAILLARD


    Herve MAILLARD Guest

  2. Similar Questions and Discussions

    1. Validator for server control inside user control
      Hello, I am facing a strange situation and have already spent a lot of time on this. I have a user control 'U' that consists of a...
    2. Adding Validator Control at runtime in a Custom Control
      Hi Wim, How do we link the TextBox to this validator control class in runtime ? Could you please tell. Thanks _ Muds. Wim Hollebrandse...
    3. output text in control location; calling control javascript from page javascript
      Hi; If you don't know, I'm just learning javascript and aspnet, but I have a pretty good grounding in windows programming. I'm trying to build a...
    4. Javascript and PHP page problem after adding new button
      Hi I took over management of an established website that I discovered was written in php and javascript (I am only familiar with html). I...
    5. problem running aspx
      Anytime I try to load an aspx file in my browser from my iis server or try to run the debugger in VS7 web project to debug aspx, I get Server...
  3. #2

    Default Re: problem with button ASPX (running javascript) since I have added a control validator.

    This is because the validator is adding it's own onClick attribute and
    overriding your one. You can turn the off the client-side validation by
    setting the EnableClientScript property to False.


    "Herve MAILLARD" <rvmaillard@free.fr> wrote in message
    news:3f1e4f73$0$16698$626a54ce@news.free.fr...
    > Hi,
    >
    > J'ai un bouton ASPX qui doit déclencher un script java.
    > I have an ASPX button running a javascript.
    >
    > To do this, I have added in the codebehind :
    >
    this.Btn_Debut.Attributes.Add("onclick","javascrip t:DatePicker('Selection_Ar
    > chives','Date_Debut')");
    >
    > So far, no problem with this...
    >
    > Then, I have added some controls validator. Then the button stop to works.
    > If I remove the validator, everythings run ok.
    >
    > Can you help me ?
    >
    > H. MAILLARD
    >
    >
    Philip Q [MVP] Guest

  4. #3

    Default Re: problem with button ASPX (running javascript) since I have added a control validator.

    You might want to look at the following articles:

    User Input Validation in ASP.NET (ASP.NET Technical Articles)
    Review the validation framework in ASP.NET and walk through an example of
    adding validation to a page. (11 printed pages)
    [url]http://msdn.microsoft.com/library/en-us/dnaspp/html/pdc_userinput.asp[/url]

    ASP.NET Validation in Depth (ASP.NET Technical Articles)
    View a detailed examination of the workings of ASP.NET validation Web
    controls. (15 printed pages)
    [url]http://msdn.microsoft.com/library/en-us/dnaspp/html/aspplusvalid.asp[/url]

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]


    "Herve MAILLARD" <rvmaillard@free.fr> wrote in message
    news:3f1e5aae$0$16662$626a54ce@news.free.fr...
    > Hi,
    >
    > I have set all the controls validator EnableClientScript property to
    False.
    > but it's still not running.
    >
    > So strange...
    > H. MAILLARD
    >
    > "Herve MAILLARD" <rvmaillard@free.fr> a écrit dans le message de news:
    > 3f1e4f73$0$16698$626a54ce@news.free.fr...
    > > Hi,
    > >
    > > J'ai un bouton ASPX qui doit déclencher un script java.
    > > I have an ASPX button running a javascript.
    > >
    > > To do this, I have added in the codebehind :
    > >
    >
    this.Btn_Debut.Attributes.Add("onclick","javascrip t:DatePicker('Selection_Ar
    > > chives','Date_Debut')");
    > >
    > > So far, no problem with this...
    > >
    > > Then, I have added some controls validator. Then the button stop to
    works.
    > > If I remove the validator, everythings run ok.
    > >
    > > Can you help me ?
    > >
    > > H. MAILLARD
    > >
    > >
    >
    >

    John Saunders Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139