I have a problem that to control calenderextender in asp.net. For instance users cannot select backdate therefore I wrote Javascript function on aspx and call it aspx.cs . But I got error
"myfunction is not defined" 
my function
<script type="text/javascript">
function myfunction() {
document.getElementById('txt_conferenceDate').onchange = function () {
var selectedDateFromCalendar = new Date(this.value);
var currentdate = new Date();
var Diff = new Date(selectedDateFromCalendar) - currentdate;
var diffDays = Math.ceil(Diff / (1000 * 3600 * 24));
if ((selectedDateFromCalendar) - currentdate < 0) {
alert("");
}
}
}
</script>
call statement
ScriptManager.RegisterClientScriptBlock(this, GetType(), "myfunction", "myfunction();", true);
