我有一个很大的应用程序,我打算为它启用快捷键。我会找到2个适用于我的JQuery插件(demo plug-in 1 - Demo plug-in 2)。你可以找到他们两个in this post in StackOverFlow如何使用jQuery触发服务器端方法
我的应用程序是一个完整的,我想增加一些功能,所以我不想再towrite代码。
所以作为一个快捷方式只是捕捉一个关键组合,我不知道如何调用快捷键应该触发的服务器方法?
那么如何通过调用我之前编写的方法来使用这些插件中的任何一个? 其实如何使用jquery引发服务器方法?
您还可以找到一个很好的文章here, by Dave Ward
更新:这里的情景。当用户按下CTRL +德尔GridView1_OnDeleteCommand所以我有这个
protected void grdDocumentRows_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
try
{
DeleteRow(grdDocumentRows.DataKeys[e.Item.ItemIndex].ToString());
clearControls();
cmdSaveTrans.Text = Hajloo.Portal.Common.Constants.Accounting.Documents.InsertClickText;
btnDelete.Visible = false;
grdDocumentRows.EditItemIndex = -1;
BindGrid();
}
catch (Exception ex)
{
Page.AddMessage(GetLocalResourceObject("AProblemAccuredTryAgain").ToString(), MessageControl.TypeEnum.Error);
}
}
private void BindGrid()
{
RefreshPage();
grdDocumentRows.DataSource = ((DataSet)Session[Hajloo.Portal.Common.Constants.Accounting.Session.AccDocument]).Tables[AccDocument.TRANSACTIONS_TABLE];
grdDocumentRows.DataBind();
}
private void RefreshPage()
{
Creditors = (decimal)((AccDocument)Session[Hajloo.Portal.Common.Constants.Accounting.Session.AccDocument]).Tables[AccDocument.ACCDOCUMENT_TABLE].Rows[0][AccDocument.ACCDOCUMENT_CREDITORS_SUM_FIELD];
Debtors = (decimal)((AccDocument)Session[Hajloo.Portal.Common.Constants.Accounting.Session.AccDocument]).Tables[AccDocument.ACCDOCUMENT_TABLE].Rows[0][AccDocument.ACCDOCUMENT_DEBTORS_SUM_FIELD];
if ((Creditors - Debtors) != 0)
labBalance.InnerText = GetLocalResourceObject("Differentiate").ToString() + "" + (Creditors - Debtors).ToString(Hajloo.Portal.Common.Constants.Common.Documents.CF) + "";
else
labBalance.InnerText = GetLocalResourceObject("Balance").ToString();
lblSumDebit.Text = Debtors.ToString(Hajloo.Portal.Common.Constants.Common.Documents.CF);
lblSumCredit.Text = Creditors.ToString(Hajloo.Portal.Common.Constants.Common.Documents.CF);
if (grdDocumentRows.EditItemIndex == -1)
clearControls();
}
钍等情况都是一样的。如何启用这些代码的快捷方式(使用会话,NHibernate等)
您可以发布在服务器端代码的一些例子吗? – 2010-06-08 12:33:47
@Mark,我会更新我的问题,查看代码示例 – 2010-06-08 13:04:56
您是否找到答案?如果是的话请在这里发布:)(谢谢你的好jQuery DatePicker插件:)我正在休闲你的网站帖子:)) – Shahin 2010-10-29 06:48:46