开发者

Data submitted on second click only C# ASP.NET

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 Arian


You need to post code.

But it comes down to events/data is not being wired the way you think it should be. You probably think the data is there, and/or the events are wired up when the page is posted back and they are not. So it isn't wired up correctly until the 2nd or 3rd post as you say. We need to see your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜