Tag: .NET

Convert Date Formats :

  //For ex., Convert MM/dd/YYYY to dd/MM/yyyy string date = “03/27/2008”; //format is MM/dd/yyyy DateTimeFormatInfo dateTimeFormatterProvider = DateTimeFormatInfo.CurrentInfo.Clone() as DateTimeFormatInfo; dateTimeFormatterProvider.ShortDatePattern = “MM/dd/yyyy”; //source date format DateTime dateTime = DateTime.Parse(date, dateTimeFormatterProvider); string formatted = dateTime.ToString(“dd/MM/yyyy”); //write the format in which you want the date tobe converted Response.Write(“<br />” + formatted);

Convert Date Formats :

  //For ex., Convert MM/dd/YYYY to dd/MM/yyyy string date = “03/27/2008”; //format is MM/dd/yyyy DateTimeFormatInfo dateTimeFormatterProvider = DateTimeFormatInfo.CurrentInfo.Clone() as DateTimeFormatInfo; dateTimeFormatterProvider.ShortDatePattern = “MM/dd/yyyy”; //source date format DateTime dateTime = DateTime.Parse(date, dateTimeFormatterProvider); string formatted = dateTime.ToString(“dd/MM/yyyy”); //write the format in which you want the date tobe converted Response.Write(“<br />” + formatted);

Maintaining Fck editor value during postbacks

Here is the code to maintain value of FckEditor value during postbacks,   Write in Page_Load event,   Page.ClientScript.RegisterOnSubmitStatement( fckContentPage.GetType(), “fckContentPage”, “FCKeditorAPI.GetInstance(‘” + fckContentPage.ClientID + “‘).UpdateLinkedField();”);   Here fckContentPage is ID of FckEditor

Boxing and UnBoxing

    Boxing and unboxing enable value types to be treated as objects. Boxing a value type packages it inside an instance of the Object reference type. This allows the value type to be stored on the garbage collected heap. Unboxing extracts the value type from the object. In this example, the integer variable i is […]

Boxing and UnBoxing

    Boxing and unboxing enable value types to be treated as objects. Boxing a value type packages it inside an instance of the Object reference type. This allows the value type to be stored on the garbage collected heap. Unboxing extracts the value type from the object. In this example, the integer variable i is […]

SingleTon Object

Introduction Sometime we need a class that has to be instantiated only once. That means we cannot have more than one instance for a class. Here singleton comes into picture. Singleton object is not a new thing come from oops concept. Let us read how easy it is. Implementation Typically every class is instantiated using […]

SingleTon Object

Introduction Sometime we need a class that has to be instantiated only once. That means we cannot have more than one instance for a class. Here singleton comes into picture. Singleton object is not a new thing come from oops concept. Let us read how easy it is. Implementation Typically every class is instantiated using […]

Introduction to .NET Remoting – Part [1]

Click Here to visit our website Welcome to the world of Distributed Application! The article will give you introduction to the world of Distributed Application development and its respective technologies. What is Remoting? “Remoting” is the process of programs interacting across certain boundaries. The boundaries are either different processes or different machines. In .NET Framework, […]

Introduction to .NET Remoting – Part [1]

Click Here to visit our website Welcome to the world of Distributed Application! The article will give you introduction to the world of Distributed Application development and its respective technologies. What is Remoting? “Remoting” is the process of programs interacting across certain boundaries. The boundaries are either different processes or different machines. In .NET Framework, […]