2012-03-06 71 views
0

我想通過單擊ajax numericupdownextender控件,基於文本框的值更改圖像控件的圖像。請在c#中提供解決方案,並告訴我如何爲此編寫自定義代碼。Numericupdownextender事件處理程序的代碼

+0

你能告訴我們你已經試過了嗎?我們想幫助您解決特定的問題。我們不是那種爲您編寫代碼的網站,我們可以幫助您解決問題。 – 2012-03-06 20:10:06

回答

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)); 
} 

如果這不能解決你的問題,那麼你需要在你的問題更清楚。