简体   繁体   English

启用回发功能的文本框textChanged事件

[英]Textbox textChanged event withount enabling postback

I have webpage with many textboxes. 我的网页上有很多文本框。 I want to call a function (CalcBalance) on TextBox_TextChanged event. 我想在TextBox_TextChanged事件上调用函数(CalcBalance)。 This works well with textbox's Postback set to true, but this makes the app not to be user friendly because when the user scrolls down to use other textboxes, the "postback" keeps taking the user to the top of the page. 在文本框的Postback设置为true的情况下,此方法效果很好,但是这会使应用程序对用户不友好,因为当用户向下滚动以使用其他文本框时,“ postback”将使用户一直位于页面顶部。 ie the user will have to scroll down after changing the text in any textbox. 也就是说,用户在更改任何文本框中的文本后都必须向下滚动。

Is there any way I can call this function without enabling postback? 有什么方法可以在不启用回发的情况下调用此函数?

Thanks to Tim Schmelter. 感谢Tim Schmelter。 The easiest way was to put this line: MaintainScrollPositionOnPostBack = "true" in the function (CalcBalance). 最简单的方法是将以下行放入:函数(CalcBalance)中的MaintenanceScrollPositionOnPostBack =“ true”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM