Insert multiple records
-
Hi all, I have an asp.net page ,contains 3 textboxes ,1 dropdownlis,1 button. I have written the code for inserting data to the database inn the button click event.Its working properly,and cleared the textbox datas. But after inserting the datas, I clear the texts in the textboxes and set visible=false. Afetr this I tried to refresh the page,the above textbox values are again inserted into the database. If somebody knows about this ,pls help me. Thanks and Regards Denny
-
Hi all, I have an asp.net page ,contains 3 textboxes ,1 dropdownlis,1 button. I have written the code for inserting data to the database inn the button click event.Its working properly,and cleared the textbox datas. But after inserting the datas, I clear the texts in the textboxes and set visible=false. Afetr this I tried to refresh the page,the above textbox values are again inserted into the database. If somebody knows about this ,pls help me. Thanks and Regards Denny
-
I have done already but still prob
-
Hi all, I have an asp.net page ,contains 3 textboxes ,1 dropdownlis,1 button. I have written the code for inserting data to the database inn the button click event.Its working properly,and cleared the textbox datas. But after inserting the datas, I clear the texts in the textboxes and set visible=false. Afetr this I tried to refresh the page,the above textbox values are again inserted into the database. If somebody knows about this ,pls help me. Thanks and Regards Denny
The postback data won't be cleared and when you refresh, it will be resend. To work around this, consider redirecting the page after insert.
// do insert
Response.Redirect("success.aspx")Best wishes, Navaneeth
-
The postback data won't be cleared and when you refresh, it will be resend. To work around this, consider redirecting the page after insert.
// do insert
Response.Redirect("success.aspx")Best wishes, Navaneeth
but sir,i have a grid in that page and i want to show the values in the grid
-
Hi all, I have an asp.net page ,contains 3 textboxes ,1 dropdownlis,1 button. I have written the code for inserting data to the database inn the button click event.Its working properly,and cleared the textbox datas. But after inserting the datas, I clear the texts in the textboxes and set visible=false. Afetr this I tried to refresh the page,the above textbox values are again inserted into the database. If somebody knows about this ,pls help me. Thanks and Regards Denny
-
This is the way ASP.NET postback works. When you refresh, your browser submits the same page with the same postback information. The only way you can avoid it is by redirecting it to a different page.
Thanks for you help
-
Hi all, I have an asp.net page ,contains 3 textboxes ,1 dropdownlis,1 button. I have written the code for inserting data to the database inn the button click event.Its working properly,and cleared the textbox datas. But after inserting the datas, I clear the texts in the textboxes and set visible=false. Afetr this I tried to refresh the page,the above textbox values are again inserted into the database. If somebody knows about this ,pls help me. Thanks and Regards Denny
What do you mean when you say 'refresh the page?' How, exactly, are you doing that? Ignore any answers that suggest that viewstate will not contain the latest value inserted into a textbox, including string.empty. Without seeing rhe code it's hard to know, but it sounds like you may be rebinding those textboxes to your datastore.
Jon
Rob Graham wrote:
100% subsidies are very popular among the 50% of the population that pays no income tax...