Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 851955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:30:46+00:00 2026-05-15T07:30:46+00:00

I have a large application and I’m going to enabling short-cut key for it.

  • 0

I have a large application and I’m going to enabling short-cut key for it. I’d find 2 JQuery plug-ins (demo plug-in 1 – Demo plug-in 2) that do this for me. you can find both of them in this post in StackOverFlow

My application is a completed one and I’m goining to add some functionality to it so I don’t want towrite code again.

So as a short-cut is just catching a key combination, I’m wonder how can I call the server methods which a short-cut key should fire?

So How to use either of these plug-ins, by just calling the methods I’d written before?
Actually How to fire Server methods with Jquery?

You can also find a good article here, by Dave Ward


Update: here is the scenario. When User press CTRL+Del the GridView1_OnDeleteCommand so I have this

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();
}

Th other scenario are the same. How to enable short-cut for these kind of code (using session , NHibernate, etc)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:30:47+00:00Added an answer on May 15, 2026 at 7:30 am

    This is directly from the links you gave.

    In your ASP.NET pg, PageName.aspx, you have a MethodName decorated with [WebMethod]. To call MethodName from a shortcut, do something like this in javascript:

    $(document).bind('keydown', 'Ctrl+c', zzz);  // hotkeys plugin
    
    function zzz() {
    
        $.ajax({
            type: "POST",
            url: "PageName.aspx/MethodName",
            data: "{}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(msg) {
                // Update your pg accordingly
            }
        });
    }
    

    Upd:

    [WebMethod]
    public static void MethodName(int rownum)
    {
        DeleteRow(rownum.ToString());
        clearControls();
        cmdSaveTrans.Text = Hajloo.Portal.Common.Constants.Accounting.Documents.InsertClickText;
        btnDelete.Visible = false;
        grdDocumentRows.EditItemIndex = -1;
        BindGrid();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large application that uses EJB 2.x entity beans (BMP). This is
I have a semi-large web application that we run locally and I need to
I have a large Compact Frameworks V2.0 application that in most cases works very
We have a large application that runs at roughly 5 locations. None of these
I have a large application that I can build through the command line. I
I have a large application that needs to ensure that various items are loaded
I have a large application in a production environment that I'm trying to move
I have a large application which Just afew Pages of that uses ViewState. I
I have a large application (~50 modules) using a structure similar to the following:
We have fairly large C++ application which is composed of about 60 projects in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.