Netferrets Online Blog, Internet Related Programming Solutions, Created in C# .net, VB .net, MS SQL Server Javascript, HTML and CSS. Proving sample solutions to problems found when creating web application solutions.
Showing posts with label string. Show all posts
Showing posts with label string. Show all posts
Saturday, 15 June 2013
Evaluate with conditions
if you want to test against a condition and two possible results and return boolean when databinding then this is quite useful. You can also use this is your code behind which makes it look less messy i.e. with anonymous types
<%# Eval("yourfield") == null ? String.Empty : Eval("yourfield")%>
Thursday, 16 May 2013
Format Twitter Feed Create Date
Here's how to format the Twitter Date to the C# .net DateTime datatype.
You will need to use "using System.Globalization;"
string date = [YourTwitterDateHere];
DateTime twitterDate = DateTime.ParseExact(date, "ddd MMM dd HH:mm:ss zzz yyyy", CultureInfo.InvariantCulture);
Why they have this format is beyond me, but this is how you can use it for what ever purpose you require in your project. Enjoy!
Subscribe to:
Posts (Atom)