<asp:button runat="server" Text="Save as" OnClick="btnSave_click"
OnClientClick="if(!Check('<% # tb.ClientID %>')) return false; return Object();"
CausesValidation="false"></asp:button>
<asp:TextBox runat="server" ID="tb"></asp:TextBox>
服务器标签在这里不起作用。我花了 1-2 个小时来找到一些方法来完成这项工作,但我没有找到任何东西。
服务器标签适用于:
<OnClientClick="JSFunc();"
<script type="text/javascript">
function JSFunc()
{
var el = document.getElementById('<% # tb.ClientID %>');
//some actions with el here
}
</script>
或其他使用 c# 的东西。
有没有办法让服务器标签内联工作?(第一个例子)
附言。抱歉英语不好