Refersh problem

Discussion in 'ASP .Net Web Controls' started by bhavik, Oct 16, 2004.

  1. bhavik

    bhavik Guest

    hi
    i have one aspx page on which i have one button

    in code behind i wrote a code for inserting a record.
    if i clicik on button it inserts a record
    ok ite fine
    but the problem is that if i refresh the page
    it will go again into button_click event and add the same record again

    why so. ?

    plz help me
    bhavik, Oct 16, 2004
    #1
    1. Advertising

  2. Because a HTTP_POST gets sent to the server. The best thing is that after
    insertion you run Response.Redirect()...

    --
    RobertK
    { Clever? No just smart. }

    "bhavik" <> wrote in message
    news:...
    > hi
    > i have one aspx page on which i have one button
    >
    > in code behind i wrote a code for inserting a record.
    > if i clicik on button it inserts a record
    > ok ite fine
    > but the problem is that if i refresh the page
    > it will go again into button_click event and add the same record again
    >
    > why so. ?
    >
    > plz help me
    >
    >
    >
    Robert Koritnik, Oct 26, 2004
    #2
    1. Advertising

  3. bhavik

    WALDO Guest

    You could also turn SmartNavigation on for the Page. When you refresh it
    doesn't re-submit. There's some caveats to doing that, though (like
    overhead). Read up on it before you use it.



    Sometimes the greatest solutions come from the simplest logic.
    Being told no is merely the incentive to do it anyway.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    WALDO, Oct 26, 2004
    #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. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,968
    Andreas Suurkuusk
    Jul 27, 2003
  2. =?Utf-8?B?Ymhhdmlr?=

    Refersh problem

    =?Utf-8?B?Ymhhdmlr?=, Oct 16, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    420
    =?Utf-8?B?RGVyZWs=?=
    Oct 21, 2004
  3. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    545
    Bullschmidt
    May 11, 2004
  4. Java_Forum

    framset & refersh question ?

    Java_Forum, Sep 4, 2003, in forum: Javascript
    Replies:
    0
    Views:
    78
    Java_Forum
    Sep 4, 2003
  5. amit
    Replies:
    6
    Views:
    78
Loading...

Share This Page