Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
How to get Mouse Click Event From Code Behind in JavaScript

How can I Pass Mouse Click Event to JavaScript function from code behind.

  imgTest.Attributes.Add("onclick", "javascript:return Test('" + sUrl + "','" + txtTest.ClientID + "','"
            + hdnTestId.ClientID  + "');");

function Test(sUrl,TestName,TestId){
    
}

How can I Get Click Event Test JavaScript Function

I Have Try eventargument not worked Please Below Code

EventArgs e  = new EventArgs();
imgTest.Attributes.Add("onclick", "javascript:return Test('" + sUrl + "','" + txtTest.ClientID + "','"
            + hdnTestId.ClientID  + "','" +  e + "');");

function Test(sUrl,TestName,TestId,EventArg){
    
}

Note :- I can't change Calling mechanism..

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Well, if you wire up a client side event?

You can always drop in a button on the page - hide it with style="display:none"

    <asp:Button ID="cmdRunServerCode" runat="server" Text="Button"  style="display:none" ClientIDMode="Static" />

    <script>

        function mytest() {
            // do whatever
            // now run server side button code
            $('#cmdRunServerCode').click()
            
        }

    </script>

So, you can use js to "click" the hidden button to run that button code stub you have server side.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!