As you can see, your current code is written in C#, so it's running on the server side - what you are going to have to do is rewrite your logic in JavaScript and then bind it in to the change logic using the ck event listener logic. You can find an example of listening to the onChange event
here[
^].