Refresh repeats last action

Discussion in 'ASP .Net' started by kj12345, Sep 28, 2004.

  1. kj12345

    kj12345 Guest

    I am writing a content management system where users can remove and
    edit data. I have a datagrid with a 'remove' button on each row. If a
    user clicks this (or 'add new', or 'edit') it works fine. However, if
    they then press refresh on their browser, .NET attempts to repeat the
    last action, which really messes things up. Is there a way to signal
    NET that, for example, an OnClick event shouldn't occur again upon
    refresh? Thanks.
     
    kj12345, Sep 28, 2004
    #1
    1. Advertising

  2. This is a browser feature. It repeats the last postback whatever it was. You
    can't get browser to change it's behavior. You should rather implement a
    sort of protection against this in your code.

    Eliyahu

    "kj12345" <-spam.invalid> wrote in message
    news:41597db5$...
    > I am writing a content management system where users can remove and
    > edit data. I have a datagrid with a 'remove' button on each row. If a
    > user clicks this (or 'add new', or 'edit') it works fine. However, if
    > they then press refresh on their browser, .NET attempts to repeat the
    > last action, which really messes things up. Is there a way to signal
    > NET that, for example, an OnClick event shouldn't occur again upon
    > refresh? Thanks.
    >
     
    Eliyahu Goldin, Sep 28, 2004
    #2
    1. Advertising

  3. kj12345

    kj12345 Guest

    What about my "add a new record" button, though? It's perfectly
    reasonable for someone to add two records in a row, so it seems to be
    nearly indistiguishable from clicking "refresh"? (Thanks for the
    response anyway, that clarifies things.)
     
    kj12345, Sep 28, 2004
    #3
  4. Re: re:Refresh repeats last action

    Understand. May be a timestamp could help? When adding a record, provide a
    timestamp in a hidden field and store it on the server. Check the timestamp
    in every new "add record" request against the previous one.

    Eliyahu

    "kj12345" <-spam.invalid> wrote in message
    news:...
    > What about my "add a new record" button, though? It's perfectly
    > reasonable for someone to add two records in a row, so it seems to be
    > nearly indistiguishable from clicking "refresh"? (Thanks for the
    > response anyway, that clarifies things.)
    >
     
    Eliyahu Goldin, Sep 29, 2004
    #4
    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. Mick
    Replies:
    1
    Views:
    710
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=
    Nov 29, 2004
  2. Amelyan
    Replies:
    2
    Views:
    4,010
    clintonG
    Dec 19, 2005
  3. Neil
    Replies:
    27
    Views:
    630
  4. Replies:
    4
    Views:
    309
    Neil Cerutti
    Dec 7, 2005
  5. cate
    Replies:
    1
    Views:
    208
    Evertjan.
    Jun 14, 2010
Loading...

Share This Page