Sora
Sora

Reputation: 2551

executing a jquery function from server side

here is my code :

string script = "GoNext()";
ScriptManager.RegisterClientScriptBlock(this, GetType(), "next", script, true);

client side :

$(document).ready(function () { 
     function GoNext() {
          $("#wizard").scrollable().next();
     }
});

i am getting a console error saying GoNext is undefined

Upvotes: 1

Views: 50

Answers (1)

Adil
Adil

Reputation: 148110

Do not put the function in $(document).ready(function () { block as its scope becomes within the ready block and it is not available in global scope.

function GoNext() {
     $("#wizard").scrollable().next();
}

Upvotes: 3

Related Questions