jquery的:
function GetSelectedRow(lnk) {
var row = lnk.parentNode.parentNode;
var rowIndex = row.rowIndex - 1;
alert("RowIndex: "+rowIndex);
return false;
}
asp.net
<asp:Button ID="EmailSendbtn" Text="Send E-Mail" runat="server" OnClientClick = "return GetSelectedRow(this)" UseSubmitBehavior="false" CommandName="SendEmail" CommandArgument='<%# Eval("Directory")+","+ Eval("FirstFile")+","+ Eval("FirstFileDateModified")%>' />
添加onClientClick后无法访问Commandname方法。当我删除它,它完美地工作。 该怎么办? 提前致谢
答案 0 :(得分:0)
简单方法: -
function showMessage(msg) {
alert(msg);
};
&#13;
<input type="button" value="click" onclick="showMessage('msgs');" />
&#13;