You can't invoke server side methods on client with your code. Try to use PageMethods in order to call server side method from client.
Javascript if statement ignored
-
08-10-2022 - |
문제
i'm new to asp.net and busy with a tutorial website.
I'm trying to call a server side function using an if statement, the problem is that the if statement is completely ignored i.e the function is called regardless.
This works when using a normal js alert
code below:
$(function () {
$("#idnum").keyup(function () {
if (this.value.length == 13) {
<%= TextBox1_TextChanged(this, idnum.Text) %> ;
//call code behind function to get contact info with ID
}
});
});
해결책
제휴하지 않습니다 StackOverflow