isLeap function in vb.net?

G

Garg

Hi,

I want to use an equivalent of isLeap function in vb.net.
Please tell me what would that be?

ret1 = (isLeap(document.all("lstYear1").value)) ? 29 : 28;
 
M

Mark Rae

I want to use an equivalent of isLeap function in vb.net.
Please tell me what would that be?

ret1 = (isLeap(document.all("lstYear1").value)) ? 29 : 28;

Assuming lstYear is a DropDownList, something like:

If DateTime.IsLeapYear(lstYear1.SelectedItem.Text) Then
ret1 = 29
Else
ret1 = 28
End If

I haven't tried the above, as I never use VB.NET...

I'm not sure if VB.NET has the ? "immediate if" operator - C# certainly
does. If not, maybe VB.NET has kept the old VB IIf(...?) syntax...?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top