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

266
Views
asp.net c# updatepanel asyncpostback javascript function

My javascript code below is running when the page is loaded. Updatepanel doesn't work when there is asyncpostback. I have tried many ways but without success.

HTML

<a onclick="direkyok()">Menü</a>

Javascript:

<script> 
  $(document).ready(function direkyok() {  
          $("body").toggleClass("mini-navbar mini-body"); 
  }); 

C# Page Load

ScriptManager.RegisterStartupScript(this, typeof(Page), 
                                                  "direkyok", "direkyok();", true);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The JavaScript function is only defined in the scope of the parameter of $(document).ready. You should make it accessible for the script manager by placing it somewhere else, e.g.:

<script> 
    //"globally" accessible
    function direkyok() {  
          $("body").toggleClass("mini-navbar mini-body"); 
    }  

    $(document).ready(/* other stuff*/);
</script>
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!