Little information about ASP.net Different Session States…


ASP.NET has different Session State modes: InProc, this is in-memory. Session State lives as long as the IIS Application Pool isn’t recycled or the entire IIS is restarted. SqlServer. This is Session State is stored in a SQL Server storage. This is great because sessions survives after an IIS Application Pool or entire IIS restart,… Read More Little information about ASP.net Different Session States…

Really nice article on Microsoft Sync Framework – thanks to Jaliya’s Blog.


Database Synchronization with Microsoft Sync Framework Thanks to http://jaliyaudagedara.blogspot.com/2013/02/database-synchronization-with-microsoft.html   Microsoft Sync Framework is a comprehensive synchronization platform enabling collaboration and offline for applications, services and devices. This is actually shipped with Visual Studio 2008 for the first time and now the current stable version is Microsoft Sync Framework 2.1. There are number of providers in… Read More Really nice article on Microsoft Sync Framework – thanks to Jaliya’s Blog.

MVC 5 & ASP.NET Best Practices – Some nice articles and tutorials.


http://www.dotnet-tricks.com/Tutorial/mvc/N50P050314-Understanding-HTML-Helpers-in-ASP.NET-MVC.html http://www.dotnet-tricks.com/Tutorial/mvc/19D9140313-Exception-or-Error-Handling-and-Logging-in-MVC4.html http://www.dotnet-tricks.com/Tutorial/mvc/4XDc110313-return-View()-vs-return-RedirectToAction()-vs-return-Redirect()-vs-return-RedirectToRoute().html http://www.dotnet-tricks.com/Tutorial/mvc/E2S9150113-Enhancing-WebGrid-with-Insert-Update-and-Delete-Operations.html http://www.dotnet-tricks.com/Tutorial/mvc/18NI110113-Enhancing-WebGrid-with-ajax-in-MVC4.html http://www.dotnet-tricks.com/Tutorial/mvc/ODJa210113-Donut-Caching-and-Donut-Hole-Caching-with-Asp.Net-MVC-4.html http://www.dotnet-tricks.com/Tutorial/designpatterns/2FMM060314-Understanding-MVC,-MVP-and-MVVM-Design-Patterns.html http://www.dotnet-tricks.com/Tutorial/dependencyinjection/bSVa100413-Understanding-Inversion-of-Control,-Dependency-Injection-and-Service-Locator.html http://www.asp.net/signalr Hope you like it…Happy Coding… 🙂 

ASP.NET WebAPI – Return image from Api to View


if you want to return an Image (i.e. Byte[]) from Api Controller to Browser (view), use following method.  public HttpResponseMessage Get(string imageName, int width, int height) { Image img = GetImage(imageName, width, height); MemoryStream ms = new MemoryStream(); img.Save(ms, System.Drawing.Imaging.ImageFormat.Png); HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); result.Content = new ByteArrayContent(ms.ToArray()); result.Content.Headers.ContentType = new MediaTypeHeaderValue(“image/png”); return result;… Read More ASP.NET WebAPI – Return image from Api to View

ASP.NET / MVC / Jquery : Metro Styles Web applications


For creating web application with Metro Style, we have good options compare to creating WPF or pure winforms applications with those complex styles.  Few packages which I have used in my projects are as below –  Bootstrap Metro – http://aozora.github.io/bootmetro/  Metro UI – http://metroui.org.ua/ Metro BootStrap – http://talkslab.com/metro-bootstrap/components.html  ( I never used this but hear that its… Read More ASP.NET / MVC / Jquery : Metro Styles Web applications

C# Write Console App with Colored lines (Command prompt with color lines)


I have this legacy old application which is running its output to console. I wanted to do something really cool rather than just showing everything in white forecolor with black backcolor. I wrote small function in my console program.cs as – public static void ColoredConsoleWrite(ConsoleColor color, string text, bool newLine) {        … Read More C# Write Console App with Colored lines (Command prompt with color lines)

Image to Base64string C#


This code snippet will help you to convert an image into a base64 string. using (MemoryStream objMemoryStream = new MemoryStream()) { string imgContentType = FileUploadLogo.PostedFile.ContentType;   // Convert Image to byte[] switch (imgContentType) { case “image/jpeg”: System.Drawing.Image.FromStream(FileUploadLogo.PostedFile.InputStream).Save(objMemoryStream, System.Drawing.Imaging.ImageFormat.Jpeg); break; case “image/gif”: System.Drawing.Image.FromStream(FileUploadLogo.PostedFile.InputStream).Save(objMemoryStream, System.Drawing.Imaging.ImageFormat.Gif); break; case “image/bmp”: System.Drawing.Image.FromStream(FileUploadLogo.PostedFile.InputStream).Save(objMemoryStream, System.Drawing.Imaging.ImageFormat.Bmp); break; case “image/png”: System.Drawing.Image.FromStream(FileUploadLogo.PostedFile.InputStream).Save(objMemoryStream, System.Drawing.Imaging.ImageFormat.Png); break; }… Read More Image to Base64string C#