开发者

ASP.NET Code Behind and Page results are mismatched

Hi I am developing开发者_开发知识库 a website using VS2010. I have started receiving an issue today which is text boxes on my pages are not populated every time while code behind shows the text is changed.

I have a text box to input an ID and on validation the record is fetched and details are shown in other text boxes. There are certain IDs on which the code behind (while debugging) shows the Text property of all text boxes are changed to reflect the fetched record but after completion of the event, text boxes are shown with previous texts, their texts are not those which were shown in the code behind.

I tried both VS2010 and VS2008. I have dual core machine. "Set Affinity" didn't work.

Please help


Did you look at Page_Load event? this event gets called every time there is a postback. Execute your initial code it is advised check for postback.

e.g.

protected void Page_Load(object sender, EventArgs e)
{
   if(!IsPostback)
   {
     //your initial code
   }
}    
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜