studio NETSOULS

Applying Web To Your Business

A lot of times in development scenarios you come to a situation where you want to do a postback on a webpage when a user hits the enter button.

If you are using RadAjaxManager on that page, then to submit the page for postback or invoke a button click event handler, use the following code: More...


Strip HTML Tags from a String

A neat regular expression function to strip the passed string of all HTML Tags.

public static string StripHTML ( string value )
{    
    // Strip the html tagstring    
    pattern = "<(.|\n)+?>";     
    string strOutput = string.Empty;      

    Regex regex = new Regex ( pattern, RegexOptions.IgnoreCase );
    // Replace all HTML tag matches with an empty     
    stringstrOutput = regex.Replace(value, string.Empty);     
    // Replace all < and > with &lt; and &gt;     
    strOutput = strOutput.Replace("<", "&lt;");     
    strOutput = strOutput.Replace ( ">", "&gt");     

    return strOutput; 
}

DateTime Formats

I am always searching the internet for the DateTime formats, so i thought i will post it in my blog so that i don’t need to keep googling for it.

Specifier String Result Output
d dd-MM-yyyy 03-01-2009
D dd MMMM yyyy 03 January 2009
f dd MMMM yyyy HH:mm:ss 03 January 2009 17:31:14
g MM/dd/yyyy HH:mm 03-01-2009 17:31:14
m MMMM dd January 03
r ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Sat, 03 Jan 2009 17:31:14 GMT
s yyyy'-'MM'-'dd'T'HH':'mm':'ss 2009-01-03T17:31:14
t HH:mm:ss 17:31:14
u yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2009-01-03 17:31:14Z
U dd MMMM yyyy HH:mm:ss 03 January 2009 12:01:14
y MMMM, yyyy January, 2009
o yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2009-01-03T17:31:14.0303453+05:30
DateTime todayDate = DateTime.Now;
string dateToStringInFormat = todayDate.ToString(formatSpecifier, 
    System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat);

Recent Project Snapshots

  • Mary Kay - Make Over Contest
  • Utility Forms
  • Oncomed
  • Nutrition Vista
  • Forysth Barr - Letter Writer Application
  • Phase One Trials - Content Management System

About Us

studio NETSOULS is a complete IT services company, offering strategy, design, development and implementation of the total solution for your web and IT initiatives. The solutions we provide, enables businesses to leverage leading edge technology to gain sustainable competitive advantages in today's marketplace.

We specialize in designing, developing and deploying the next generation of IT solutions including e-business solutions Read more...

Month List