Well you can use Normal JavaScript for this.
On the onblur event of the due date textbox, call a Js function which will take the value from the due date textbox and then compare it with the current date and do calculations accordingly.
Below is a sample code which might help:
<asp:textbox id="txtDueDate" runat="server" onblur="CallMe();" xmlns:asp="#unknown"></asp:textbox>
<asp:textbox id="txtFine" runat="server" xmlns:asp="#unknown"></asp:textbox>
Js code:
<script type="text/javascript">
function CallMe(){
var oneDayFine=5;
var dateVariable=document.getElementById('txtDueDate').value;
var dueDate=new Date("dateVariable");
var currentDate=new Date();
var differenceinDays=Math.Abs(currentDate.getTime()-dueDate.getTime());
if(differenceinDays>0)
{
var totalFine=oneDayFine*differenceinDays;
document.getElementById('txtFine').value=totalFine;
}
else
{
window.alert('No Fine');
}
}
</script>
The only thing you need to take care is that what format is the time coming from your UI. I suggest you use a DateTimePicker instead.The code may not be perfect but it will give you an insight. try it
Anurag