开发者

TextBox.Text Changing Unexpectedly

开发者 https://www.devze.com 2023-01-21 00:36 出处:网络
I\'m updating a LINQ object prior to SubmitChanges.The values of the object\'s properties are being taken from a series of TextBoxes.

I'm updating a LINQ object prior to SubmitChanges. The values of the object's properties are being taken from a series of TextBoxes.

When I read in one specific TextBox, another TextBox changes its value with no apparent cause.

开发者_Go百科
//...
loc.Lattitude = txtLocLat.Text; // txtLocLong.Text changes to previous value
loc.Longitude = txtLocLong.Text; // Which is now the previous value
dc.SubmitChanges();
// ...

As a result, loc.Longitude never gets updated with the user input. Why would it do this?

  • The TextBoxes have no databindings
  • The TextBoxes have no events defined
  • Breakpointing into the first line merely steps through the DataContext's loc.Lattitude setter.


Try putting a breakpoint on the txtLocLong TextChanged event and see if the stack trace is any help.

0

精彩评论

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

关注公众号