Professional Web Applications Themes

ASP Caching - ASP.NET General

Hello, I have a simple web form page in which I insert/update data to a database. The SQL code to insert data is written in a server side submit button. Every thing works fine. But,Whenever I insert a record (by hitting the submit button) and immediately refresh the page using F5 or page refresh in IE, I see a duplicate entry entered into the database exactly with the same values of my previous insert. However the values for all the controls in the form are empty. I would really appreciate if some one can help on this. Thanks in advance....

  1. #1

    Default ASP Caching

    Hello,
    I have a simple web form page in which I insert/update
    data to a database. The SQL code to insert data is
    written in a server side submit button. Every thing works
    fine. But,Whenever I insert a record (by hitting the
    submit button) and immediately refresh the page using F5
    or page refresh in IE, I see a duplicate entry entered
    into the database exactly with the same values of my
    previous insert.
    However the values for all the controls in the form are
    empty. I would really appreciate if some one can help on
    this.
    Thanks in advance.
    Mahesh Guest

  2. #2

    Default Re: ASP Caching

    i suggest that after inserting/updating is successful, try to redirect to
    confirmation page thus to avoid refreshing the postback page.

    hope this helps.

    "Mahesh" <msmahehvzavenue.net> wrote in message
    news:068301c34a80$1b08d9a0$a301280aphx.gbl...
    > Hello,
    > I have a simple web form page in which I insert/update
    > data to a database. The SQL code to insert data is
    > written in a server side submit button. Every thing works
    > fine. But,Whenever I insert a record (by hitting the
    > submit button) and immediately refresh the page using F5
    > or page refresh in IE, I see a duplicate entry entered
    > into the database exactly with the same values of my
    > previous insert.
    > However the values for all the controls in the form are
    > empty. I would really appreciate if some one can help on
    > this.
    > Thanks in advance.

    Benjie Fallar Guest

  3. #3

    Default Re: ASP Caching

    Thank you for your reply.
    But the problem is doesn't happen every time. Only when I
    manually hit refresh after I hit the submit button. It is
    a data entry screen, so users wanted to stay remain in
    the screen after inserting a new record. For some reason
    if they hit refresh then the same record is likely to be
    inserterd twice or whenever they hit refresh.


    >-----Original Message-----
    >i suggest that after inserting/updating is successful,
    try to redirect to
    >confirmation page thus to avoid refreshing the postback
    page.
    >
    >hope this helps.
    >
    >"Mahesh" <msmahehvzavenue.net> wrote in message
    >news:068301c34a80$1b08d9a0$a301280aphx.gbl...
    >> Hello,
    >> I have a simple web form page in which I insert/update
    >> data to a database. The SQL code to insert data is
    >> written in a server side submit button. Every thing
    works
    >> fine. But,Whenever I insert a record (by hitting the
    >> submit button) and immediately refresh the page using
    F5
    >> or page refresh in IE, I see a duplicate entry entered
    >> into the database exactly with the same values of my
    >> previous insert.
    >> However the values for all the controls in the form are
    >> empty. I would really appreciate if some one can help
    on
    >> this.
    >> Thanks in advance.
    >
    >
    >.
    >
    Mahesh Guest

  4. #4

    Default Re: ASP Caching

    Better use bool variable..
    When it enters the submit event set it as 1 and as soon as it get submited into database make this bool as 0.
    Before submiting check for this variable.
    praveen.khade Guest

Similar Threads

  1. Caching in FMS 2.0.4
    By abhongir in forum Macromedia Flash Flashcom
    Replies: 1
    Last Post: January 11th, 06:34 PM
  2. web svc caching
    By Saverio Tedeschi in forum ASP.NET Web Services
    Replies: 0
    Last Post: July 17th, 01:43 PM
  3. Caching
    By John S in forum ASP
    Replies: 0
    Last Post: October 3rd, 02:45 PM
  4. FM caching
    By Disco Stu in forum FileMaker
    Replies: 3
    Last Post: September 1st, 09:13 PM
  5. .NET Web Caching
    By Tim in forum ASP.NET General
    Replies: 3
    Last Post: August 6th, 07:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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