When your controls are inside another INamingContainer, their identifiers are longer than this (in your case, at least Content2$chkaspinstead chkasp, maybe more), use this .ClientIDto solve this problem, for example:
$(function() {
$('#<%=chkasp.ClientID %>').click(function() {
if ($(this).is(':checked')) {
$("#<%=txtasp.ClientID %>").mask("999-99-9999");
} else {
$("#<%=txtasp.ClientID %>").mask("99/99/9999");
}
});
Or shorten it with a conditional expression:
$('#<%=chkasp.ClientID %>').click(function() {
$("#<%=txtasp.ClientID %>").mask($(this).is(':checked') ?
"999-99-9999" : "99/99/9999");
});