Refresh problem

S

sandhya.net

Hi,

I have a dropdown which displays the Products and Add button on my
Asp.net web page. When the user selects a product from the dropdown
and
Clicks the add button it adds the selected product to the datagrid.

The problem is when the user adds the product and clicks the refresh
button on the browser,the same item is added to the datagrid once
again. How to prevent calling Add_click Event when the refresh is
clicked on the web page.

Any help, greatly appreciated.

Thanks in advance,
Sandhya.net

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
E

Eliyahu Goldin

It's a known problem of refresh button behavior. It always repeat the last
postback exactly as it was. You can't change it. You can fight it only on
server side by supplying a sort of unique identification for each Add
operation. If another Add postback comes with the same id, it must be
because of refresh and you can ignore it.

Eliyahu
 
G

Guest

Hi,

After clicking the "Add" button, a postback occurs, and it executes the code
on the server side, in your case, it adds the product to datagrid, and sent
to the client browser. When the client clicks the refresh button on his
browser, the same thing occurs again. Add the product is added once more. You
can't do anything with that. You can instruct the client, not to click the
"Refresh" button.

R U from India? Me too.

Prakash.C
 
G

Guest

Hi,

After clicking the "Add" button, a postback occurs, and it executes the code
on the server side, in your case, it adds the product to datagrid, and sent
to the client browser. When the client clicks the refresh button on his
browser, the same thing occurs again. Add the product is added once more. You
can't do anything with that. You can instruct the client, not to click the
"Refresh" button.

R U from India? Me too.

Prakash.C
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top