Data submitted on second click only C# ASP.NET

Posted by Arianule under ASP.NET on 5/6/2011 | Points: 10 | Views : 1548 | Status : [Member] | Replies : 1
Hallo there
I have an interesting problem on which I was hoping to gain some insight.
I have a page with some textboxes an a radiobutton list and the information I submit to an access database in a web service.
When I click the submit button there seems to be a post back but the data is not inserted into the database and only after the second click does it get inserted without any problems.
If I wait a few minutes (strangely enough) then the info is submitted upon the first click.
I am using session variables within which I store information and when this page is loaded the information stored in the session variables is displayed in the textboxes with Read-Only enabled. I then make a selection on the radion button list and add some additional information in another textbox before I click on submit which seems to "kick" away..I presume it is a postback... and then if I click for the second time only then the information is submitted.

Could the info loaded into the textboxes of the page from the session variables perhaps be the problem and how would I go about in overcoming this?

I do use if (IsPostBack) with the loading and the problem remains. If I do not add (!IsPostBack) the problem is worse and sometimes the info is only submitted after the third click.

Kind regards


Posted by: Sina on: 5/19/2011 [Member] Starter | Points: 25

Hi the problem sounds creepy !! Do a check on the C# coding (source) if there are more than 1 click event for the button .


Arianule, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response