seems to be the same code , i used the code posted in this thread in my application and add the management of setValue() method, because i used this fonctionality to retrieve data from server and popolate fields with mask enabled

I'am not developper on C# but try to execute the code in the client Side
because the mask needs to get the value that is written in the client side