, TimeSpan, DateTime. , :
TimeSpan t = new TimeSpan(0, 1, 8);
decimal d = t.Minutes + (t.Seconds / 60m);
Console.WriteLine(d.ToString());
. m 60 .
You cannot connect this C # directly to the onblur text field, since it works on the server side. If you need to run this on the client side, you will either have to use the ajax callback to evaluate it, or use javascript to cut the line, then calculate each bit (minutes and seconds) separately, then output the result to a second text box or label.
source
share