Stop ObjectDataSource from refreshing when CustomValidator is false

Discussion in 'ASP .Net' started by Don, Feb 29, 2008.

  1. Don

    Don Guest

    I have a page with a GridView that uses an ObjectDataSource. The user
    can change some parameters on the page and refresh the GridView with a
    button click. One of the parameters has a CustomValidator that uses
    server side logic to determine if the value is valid.
    When the value is invalid my validator displays but the GridView still
    refreshes. I think this is because a GridView bound to an
    ObjectDataSource always refreshes when any postback is performed. How
    can I stop it?


    Thanks,
    Don
    Don, Feb 29, 2008
    #1
    1. Advertising

  2. Don

    Manish Guest

    RE: Stop ObjectDataSource from refreshing when CustomValidator is fals

    Hi Don,

    I think you can try the client side validation for your customValidations in
    order to avoid postback.

    Please refer to the link below if this helps.

    http://www.c-sharpcorner.com/UploadFile/purankaushal/103222006013805AM/1.aspx

    Regards,
    Manish
    www.ComponentOne.com

    "Don" wrote:

    > I have a page with a GridView that uses an ObjectDataSource. The user
    > can change some parameters on the page and refresh the GridView with a
    > button click. One of the parameters has a CustomValidator that uses
    > server side logic to determine if the value is valid.
    > When the value is invalid my validator displays but the GridView still
    > refreshes. I think this is because a GridView bound to an
    > ObjectDataSource always refreshes when any postback is performed. How
    > can I stop it?
    >
    >
    > Thanks,
    > Don
    >
    Manish, Feb 29, 2008
    #2
    1. Advertising

  3. Don

    Don Guest

    Re: Stop ObjectDataSource from refreshing when CustomValidator isfals

    I use client side validation when I can. In this case, I need server
    side because I need to use a server side object that queries the
    database and applies some business logic.


    On Feb 29, 2:17 pm, Manish <> wrote:
    > Hi Don,
    >
    > I think you can try the client side validation for your customValidations in
    > order to avoid postback.
    >
    > Please refer to the link below if this helps.
    >
    > http://www.c-sharpcorner.com/UploadFile/purankaushal/103222006013805A...
    >
    > Regards,
    > Manishwww.ComponentOne.com
    >
    >
    >
    > "Don" wrote:
    > > I have a page with a GridView that uses an ObjectDataSource.  The user
    > > can change some parameters on the page and refresh the GridView with a
    > > button click.  One of the parameters has a CustomValidator that uses
    > > server side logic to determine if the value is valid.
    > > When the value is invalid my validator displays but the GridView still
    > > refreshes.  I think this is because a GridView bound to an
    > > ObjectDataSource always refreshes when any postback is performed.  How
    > > can I stop it?

    >
    > > Thanks,
    > >    Don- Hide quoted text -

    >
    > - Show quoted text -
    Don, Feb 29, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jose Fernandez

    CUSTOMVALIDATOR works but page goes on on FALSE

    Jose Fernandez, Jun 1, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    496
    Peter Blum
    Jun 2, 2005
  2. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    445
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  3. DJ
    Replies:
    3
    Views:
    908
  4. Jose Fernandez

    CUSTOMVALIDATOR works but page goes on on FALSE

    Jose Fernandez, Jun 1, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    120
    Jose Fernandez
    Jun 1, 2005
  5. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    179
    Harlan Messinger
    Aug 3, 2006
Loading...

Share This Page