嘿,我想弄清楚为什么我的页面加载时会出现此错误:
Compiler Error Message: BC30456: 'showNotifier' is not a member of 'ASP.pro_aspx'.
showNotifier 是一个 javascript 调用,我必须使用 jQuery 显示从浏览器屏幕顶部下拉的错误消息。我在我的母版页中加载了 javascript 代码,所以我知道它在任何页面上。
这是我的图像按钮代码:
<asp:ImageButton ID="btnDelete" CommandName="Delete" CommandArgument='<%#Eval("id") %>' Text="Delete" runat="server" CssClass="delIcon" AlternateText="Delete" ToolTip="Delete" ImageUrl="~/del.png" />
任何帮助都会很棒!
附加代码
Protected Sub grdView_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles grdView.RowCommand
Dim cid As String = e.CommandArgument.ToString
Dim command As String = e.CommandName.ToString
If cid.Length <= 0 Then Exit Sub
Select Case command
Case "Delete"
Delete(cid)
End Select
End Sub
附加代码 2
Private Sub grdView_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdView.RowDataBound
If (e.Row.RowType = DataControlRowType.DataRow) Then
Dim l As ImageButton = CType(e.Row.FindControl("btnDelete"), ImageButton)
l.Attributes("OnClientClick") = "if(msgBoxShow('Are you sure you want to delete " & DataBinder.Eval(e.Row.DataItem, "Name") & "?','" & DataBinder.Eval(e.Row.DataItem, "Name") & "','')==false){return false;}"
End If
End Sub
Javascript代码是这样的:
<script type="text/javascript">
function msgBoxShow(boxsaying, prodItemName, codeBehind) {
apprise(boxsaying, {
'verify': true,
'textYes': 'Delete ' + prodItemName,
'textNo': 'Cancel delete'
},
function (r) {
if (r) {
//alert('yes');
return true;
} else {
//alert('no');
return false;
}
}
);
}
</script>