Click here to Skip to main content
15,891,184 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: postback using javascript Pin
rahul.net112-May-08 0:59
rahul.net112-May-08 0:59 
QuestionComparing date's in .NET (web forms)?? [modified] Pin
Karan_TN1-May-08 22:41
Karan_TN1-May-08 22:41 
AnswerRe: Comparing date's in .NET (web forms)?? Pin
Hesham Amin1-May-08 23:19
Hesham Amin1-May-08 23:19 
GeneralRe: Comparing date's in .NET (web forms)?? Pin
Karan_TN1-May-08 23:52
Karan_TN1-May-08 23:52 
GeneralRe: Comparing date's in .NET (web forms)?? Pin
J4amieC2-May-08 0:05
J4amieC2-May-08 0:05 
GeneralRe: Comparing date's in .NET (web forms)?? Pin
Hesham Amin2-May-08 1:11
Hesham Amin2-May-08 1:11 
GeneralRe: Comparing date's in .NET (web forms)?? Pin
Vasudevan Deepak Kumar2-May-08 0:34
Vasudevan Deepak Kumar2-May-08 0:34 
AnswerRe: Comparing date's in .NET (web forms)?? Pin
J4amieC2-May-08 0:12
J4amieC2-May-08 0:12 
I would say the easiest way to do this is to put all your dates into an array and sort them. The default sort will order them oldest first and most recent last. here's some example code (writen in a console app for testing):
DateTime[] dts = new DateTime[4];
dts[0] = new DateTime(1987, 10, 23);
dts[1] = new DateTime(2000, 11, 7);
dts[2] = new DateTime(2008, 2, 2);
dts[3] = new DateTime(2008, 1, 2);

Console.WriteLine("Before Sort");
foreach (DateTime dt in dts)
    Console.WriteLine(dt);

Array.Sort<datetime>(dts);

Console.WriteLine("After sort");
foreach (DateTime dt in dts)
    Console.WriteLine(dt);

Console.WriteLine("Most recent date: {0}",dts[dts.Length - 1]);
Console.ReadLine();</datetime>


Now, if they happen to be an a List, the code is pretty similar. If you want to sort them a different way Array.Sort can take a second parameter which allows you to specify how the sorting takes place. Check the docs for more info.
AnswerRe: Comparing date's in .NET (web forms)?? Pin
Vasudevan Deepak Kumar2-May-08 0:32
Vasudevan Deepak Kumar2-May-08 0:32 
QuestionRe: Comparing date's in .NET (web forms)?? Pin
Karan_TN2-May-08 2:35
Karan_TN2-May-08 2:35 
QuestionASP.NET web application will not use updated dll file. Pin
bin_bin11-May-08 22:37
bin_bin11-May-08 22:37 
AnswerRe: ASP.NET web application will not use updated dll file. Pin
eyeseetee1-May-08 22:45
eyeseetee1-May-08 22:45 
AnswerRe: ASP.NET web application will not use updated dll file. Pin
Vasudevan Deepak Kumar2-May-08 0:35
Vasudevan Deepak Kumar2-May-08 0:35 
Questionrecommendation for adding the class file Pin
Sonia Gupta1-May-08 22:30
Sonia Gupta1-May-08 22:30 
AnswerRe: recommendation for adding the class file Pin
eyeseetee1-May-08 22:44
eyeseetee1-May-08 22:44 
AnswerRe: recommendation for adding the class file Pin
rahul.net111-May-08 23:00
rahul.net111-May-08 23:00 
AnswerRe: recommendation for adding the class file Pin
N a v a n e e t h1-May-08 23:22
N a v a n e e t h1-May-08 23:22 
AnswerRe: recommendation for adding the class file Pin
Vasudevan Deepak Kumar2-May-08 0:36
Vasudevan Deepak Kumar2-May-08 0:36 
QuestionHow can I convert hexadecimal stream to a Image? Pin
pubududilena1-May-08 22:24
pubududilena1-May-08 22:24 
AnswerRe: How can I convert hexadecimal stream to a Image? Pin
J a a n s1-May-08 22:51
professionalJ a a n s1-May-08 22:51 
GeneralRe: How can I convert hexadecimal stream to a Image? Pin
pubududilena1-May-08 23:32
pubududilena1-May-08 23:32 
GeneralRe: How can I convert hexadecimal stream to a Image? Pin
J a a n s2-May-08 1:41
professionalJ a a n s2-May-08 1:41 
QuestionWeb tabstrip user control Pin
bijeshputhalath1-May-08 22:18
bijeshputhalath1-May-08 22:18 
QuestionDropdownlist without autopostback [modified] Pin
raushan_91-May-08 21:24
raushan_91-May-08 21:24 
AnswerRe: Dropdownlist without autopostback Pin
eyeseetee1-May-08 22:31
eyeseetee1-May-08 22:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.