我想通过单击ajax numericupdownextender控件来更改基于文本框值的图像控件的图像。请在c#中提供解决方案,并告诉我如何为此编写自定义代码。
答案 0 :(得分:0)
我想你会想要使用NumericUpDownExtender的currentChanged事件。这会触发事件客户端(在javascript中 - 而不是C#)。
“NumericUpDown扩展器只有一个事件,currentChanged。只要通过向上/向下按钮更改扩展文本框的值或用户在该文本框中键入新值,就会触发此事件。如果键入,只要焦点离开文本框,事件就会触发。“
function pageLoad(sender, args) {
$find('<%= NumericUpDownExtenderID.ClientID %>').add_currentChanged(methodtocall);
}
function methodtocall(sender, e) {
alert(String.format('change event fired. Value: {0}', e));
}
如果这不能解决您的问题,那么您需要更清楚地解决问题。