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