0
其目的是在OnClientClick事件內附加JavaScript代碼,以傳遞SearchIDTextbox的值作爲ID參數。如果我硬編碼「22」爲???? 函數運行正常。我thinK我需要做?單個值綁定表達式 但我在設置代碼時遇到問題。單值綁定
<asp:ImageButton ID="PremiumUserImageButton" Width="40px" OnClientClick="return clientClickEvent('AdvancedSearch.aspx?ID= ????)" CausesValidation="False" ImageUrl="~/Images/Premium.gif" runat="server" />
想這沒有運氣!
<asp:ImageButton ID="PremiumUserImageButton" Width="40px" OnClientClick="return clientClickEvent('AdvancedSearch.aspx?ID='<%# GetID() %>'" CausesValidation="False" ImageUrl="~/Images/Premium.gif" runat="server" />
需要先通過javascript中的document.getelementbyid方法獲得'searchTextbox'的值,並將其作爲參數分配給函數。 – Rahul