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 905017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:08:45+00:00 2026-05-15T16:08:45+00:00

Let say I got the following button : <asp:Button ID=btnSearch runat=server /> and the

  • 0

Let say I got the following button : <asp:Button ID="btnSearch" runat="server" /> and the following button event handler :

Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSearch.Click

How, with JQuery, can I call the button event handler ?

What I mean is that I don’t want the page to refresh, so it’s kind of Ajax call. I don’t want to simulate the click but that on click the button event handler is call.

  • 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-15T16:08:45+00:00Added an answer on May 15, 2026 at 4:08 pm
    $("#<%= btnSearch.ClientID %>").click();
    

    UPDATE

    There are many ways of doing this asynchronously. You could have your button be set up as a trigger for an UpdatePanel, and then my original answer would still work. I wouldn’t do that, but that’s because I hate UpdatePanels.

    You could create a page method in your code behind class, like this:

    [WebMethod]
    public static void Search()
    {
        // Do search
    }
    

    and in your ScriptManager (you’ll have to add one if you don’t have it), enable page methods.

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
    

    Then, you don’t even need a server control for your button. Just use a plain old button.

    <input type="button" onclick="search()" value="Search" />
    
    // Then in javascript...
    function search()
    {
        PageMethods.Search(function(result)
        {
            // deal with search result here (this is the success handler)
        });
    }
    

    Or you could call your page method directly from jquery, as shown by this Encosia article.

    Or, you could have a completely separate service, not part of your code behind, that encapsulates your search logic, and you could call it any number of ways.

    Since you’ve updated your question, you’re question isn’t really about how to execute your button’s click handler, it’s about how to do an async operation. And it’s a little vague. There are a million ways to do that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let say I got the following : DECLARE @ExcludedList VARCHAR(MAX) SET @ExcludedList = 3
Let's say I've got the following data in one-to-many tables city and person, respectively:
Let's say I've got a Java object that's got among others the following methods:
Let say I got the following code in my SqlUserRepository : var user =
Let's say that I got the following code in a page: elit ac <a
Let's say that I've got the following class hierarchy : public static class Constants
I got the following problem: I have 2 databases, let's say DB1 and DB2
Let's say I've got a database full of music artists. Consider the following artists:
Let say I got the following : public class A { [MyAttribute] public void
Let's say that I got the following class and enum: public class MyModel {

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.