Going crazy with requiredfieldvalidator controls . Kindly help me

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

  1. #1

    Default Going crazy with requiredfieldvalidator controls . Kindly help me

    Hello friends...
    On a single asp.net web page i have a single server-side form that contains
    a couple of user-controls. Each user control has its own functionality and
    contains server-side textbox controls, requiredfieldvalidator controls which
    validate the textboxes, and a linkbutton control that postbacks the web
    page. The problem is, when the user clicks on the linkbutton control on one
    user control, the requiredfieldvalidator gets executed for all the user
    controls that are present on the page. We only need the
    requiredfieldvalidator controls to get executed for the user-control on
    which the user clicked the linkbuttons. How can we do this. I have actually
    asked this question 3 months back on this newsgroup, and no one actually
    answered. I am still struggling to find out how this can be done. Please
    help.

    Thanks alot

    Navin


    Navin Guest

  2. Similar Questions and Discussions

    1. Kindly Guide
      Hi all, I am trying to stream, the media content from flash media server to My WM5.0 SP device/ O2 device.... I am having flash...
    2. Please- I really need some assistance-thankyou kindly- greatly appreciated
      Gazing into my crystal ball I observed "Cekaitah" <wish@dreamsenders.com> writing in news:vsthe.55293$vN2.30509@clgrps13: Do you have a URL? ...
    3. cfchart and cfchartdata question. Kindly help!
      Hello everybody, I really need someone to help me here. I'm new to charting. I'm developing a graphical interface to report the no of jobs logged in...
    4. scroll bars - kindly go away
      Hi there, I ran into this site (don't ask how) and the layout seems to contradict something someone else told me about scroll bars and browser...
    5. Question about RequiredFieldValidator
      I've created a simple form with a submit button and a textfield. I assigned a RequiredFieldValidator to the textfield and set EnabledClientScript...
  3. #2

    Default Re: Going crazy with requiredfieldvalidator controls . Kindly help me

    Navin,

    The controls on a page that trigger a post back to the server (like your
    button and link controls) trigger client side and server side page
    validation to occurr for the entire page their behaviour is designed this
    way.

    First for any control that should post back to the server that shouldn't
    trigger a page validation of any sort I would set it's "CausesValidation"
    property to false.

    The other controls are going to be difficult if not impossible to use the
    way you want with client side validation. You may have to resort to setting
    all the button and links on your page to not cause validation and just do
    your required field validation on post back. You would do this by calling
    the required field validator's "Validate" method server side.

    If you need client side validation you may need to write your own javascript
    to do so.

    I know this isn't what you were hoping to hear, but the validation objects
    just weren't created to be split up like that. They work on a form wide
    basis and the entire page is one single form...

    Sorry,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche
    "Navin" <nv@nv.com> wrote in message
    news:eGrv8lGVDHA.384@TK2MSFTNGP12.phx.gbl...
    > Hello friends...
    > On a single asp.net web page i have a single server-side form that
    contains
    > a couple of user-controls. Each user control has its own functionality and
    > contains server-side textbox controls, requiredfieldvalidator controls
    which
    > validate the textboxes, and a linkbutton control that postbacks the web
    > page. The problem is, when the user clicks on the linkbutton control on
    one
    > user control, the requiredfieldvalidator gets executed for all the user
    > controls that are present on the page. We only need the
    > requiredfieldvalidator controls to get executed for the user-control on
    > which the user clicked the linkbuttons. How can we do this. I have
    actually
    > asked this question 3 months back on this newsgroup, and no one actually
    > answered. I am still struggling to find out how this can be done. Please
    > help.
    >
    > Thanks alot
    >
    > Navin
    >
    >

    S. Justin Gengo Guest

  4. #3

    Default Re: Going crazy with requiredfieldvalidator controls . Kindly help me

    Navin,

    I thought of one other possibility.

    If a required field validator's "Enabled" property is set to "False" then,
    of course, it doesn't stop the page from being posted. Even if the object it
    validates doesn't have a value.

    I just checked and the validator is still rendered on the page even if it is
    not enabled.

    You should be able to enable or disable the validators client side depending
    on which button holds focus.

    This should let you do exactly what you want.

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche
    "Navin" <nv@nv.com> wrote in message
    news:eGrv8lGVDHA.384@TK2MSFTNGP12.phx.gbl...
    > Hello friends...
    > On a single asp.net web page i have a single server-side form that
    contains
    > a couple of user-controls. Each user control has its own functionality and
    > contains server-side textbox controls, requiredfieldvalidator controls
    which
    > validate the textboxes, and a linkbutton control that postbacks the web
    > page. The problem is, when the user clicks on the linkbutton control on
    one
    > user control, the requiredfieldvalidator gets executed for all the user
    > controls that are present on the page. We only need the
    > requiredfieldvalidator controls to get executed for the user-control on
    > which the user clicked the linkbuttons. How can we do this. I have
    actually
    > asked this question 3 months back on this newsgroup, and no one actually
    > answered. I am still struggling to find out how this can be done. Please
    > help.
    >
    > Thanks alot
    >
    > Navin
    >
    >

    S. Justin Gengo Guest

  5. #4

    Default Re: Going crazy with requiredfieldvalidator controls . Kindly help me

    Yes Justin... this last idea that u gave me sounds a little good and I am
    testing things out with it.
    Thanks for your idea.

    "S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
    news:%23Alu7GSVDHA.2288@TK2MSFTNGP12.phx.gbl...
    > Navin,
    >
    > I thought of one other possibility.
    >
    > If a required field validator's "Enabled" property is set to "False" then,
    > of course, it doesn't stop the page from being posted. Even if the object
    it
    > validates doesn't have a value.
    >
    > I just checked and the validator is still rendered on the page even if it
    is
    > not enabled.
    >
    > You should be able to enable or disable the validators client side
    depending
    > on which button holds focus.
    >
    > This should let you do exactly what you want.
    >
    > --
    > S. Justin Gengo, MCP
    > Web Developer
    >
    > Free code library at:
    > [url]www.aboutfortunate.com[/url]
    >
    > "Out of chaos comes order."
    > Nietzche
    > "Navin" <nv@nv.com> wrote in message
    > news:eGrv8lGVDHA.384@TK2MSFTNGP12.phx.gbl...
    > > Hello friends...
    > > On a single asp.net web page i have a single server-side form that
    > contains
    > > a couple of user-controls. Each user control has its own functionality
    and
    > > contains server-side textbox controls, requiredfieldvalidator controls
    > which
    > > validate the textboxes, and a linkbutton control that postbacks the web
    > > page. The problem is, when the user clicks on the linkbutton control on
    > one
    > > user control, the requiredfieldvalidator gets executed for all the user
    > > controls that are present on the page. We only need the
    > > requiredfieldvalidator controls to get executed for the user-control on
    > > which the user clicked the linkbuttons. How can we do this. I have
    > actually
    > > asked this question 3 months back on this newsgroup, and no one actually
    > > answered. I am still struggling to find out how this can be done. Please
    > > help.
    > >
    > > Thanks alot
    > >
    > > Navin
    > >
    > >
    >
    >

    Navin 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