Dear friends
i am using this code to sow a countdown timer in an online exam project :
Default.aspx page coding
Interval="1000" OnTick="timer1_tick">
runat="server" UpdateMode="Conditional">
Default.aspx.cs page coding
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!SM1.IsInAsyncPostBack)
Session["timeout"] = DateTime.Now.AddMinutes(120).ToString();
}
protected void timer1_tick(object sender, EventArgs e)
{
if (0 > DateTime.Compare(DateTime.Now,DateTime.Parse(Session["timeout"].ToString())))
{
lblTimer.Text = "Number of Minutes Left: " +((Int32)DateTime.Parse(Session["timeout"].ToString()).Subtract(DateTime.Now).TotalMinutes).ToString();
}
}
}
now i wanted to know how i show time into minutes and second format , because this coding only show minutes 
VulpesRank #55 · 29.2K reputationPosted Mar 19, 2014, 2:04 AM EDT
VulpesRank #55 · 29.2K reputationPosted Mar 18, 2014, 6:39 AM EDT
Nitin Sharma152 reputationPosted Mar 19, 2014, 1:47 AM EDT
please help me
VulpesRank #55 · 29.2K reputationPosted Mar 19, 2014, 1:52 AM EDT
Nitin Sharma152 reputationPosted Mar 19, 2014, 2:40 AM EDT
i hope u will guide me in future
thanks
Stephan Shere4 reputationPosted Mar 19, 2014, 2:44 PM EDT
VulpesRank #55 · 29.2K reputationPosted Mar 19, 2014, 3:03 PM EDT
Stephan Shere4 reputationPosted Mar 19, 2014, 6:57 PM EDT
TimeSpan TimeLeft = Timeout.Subtract(DateTime.Now);
Console.WriteLine("Time remaining: {0} minutes {1} seconds", TimeLeft.TotalMinutes, TimeLeft.Seconds);
TimeLeft.TotalMinutes = 1
.Seconds to show seconds left in the current minute.
.TotalSeconds to show the total seconds overall.
Vs:
TimeLeft.Hours = 1
TimeLeft.Minutes = 59
Nitin Sharma152 reputationPosted Mar 20, 2014, 4:08 AM EDT
Shamkant sapkaleRank #8,316 · 224 reputationPosted May 17, 2016, 11:33 PM EDT