Not used! Page.isPostBack appears wrong

xiaoxiao2021-04-03  220

Unused errors that do not page.ispostback

Today, use .NET to debug a program, due to time comparison, in all pages Page_Load's judgment statement, start me, start me, in a data update page, I tried first in Page_Load from the database Read the data into TextBox, everything is normal, but I update the button, the strange thing appears, although the data in TextBox has just modified, but after the update, still old data, I tried to put TextBox The data is printed with Response.write. The result shows the data before the unmodified data. I spent a long time and didn't find a wrong reason. Finally, I think is the page in the page when the page is returned, and the data in the TextBox is Page_Load The event is restored, so I added a NOT Page.ispostback's judgment statement, and the update was successful, so I thought that the Button button triggered first, and then the Click event, hey, and a long time!

转载请注明原文地址:https://www.9cbs.com/read-131573.html

New Post(0)