UI Updates – Part 2

ASP.NET ASP.NET UI updates are handles using Ajax. In this example it is described how to use the ASP.NET Ajax for the updates. In ASP.NET Ajax we can have update panel and make the updates via Ajax calls. Prepare your ASPX markup like below. 1: <body> 2: <form id=”form1″ runat=”server”> 3: <asp:ScriptManager ID=”ScriptManager1″ runat=”server”></asp:ScriptManager> 4: … Continue reading UI Updates – Part 2

Delegates

Methods are delegate types. It is that simple. Since delegates are types in .NET we can use any method as types, that means we can pass methods as parameters and we can return methods. The below code shows different ways we can instantiate a delegate. 1: namespace DelegatesVsInterfaces 2: { 3: public delegate string MyDelegate(string … Continue reading Delegates

Put watermarks on uploaded images–ASP.NET

Here’s the simples piece of code in C# which can write some text on an image, eventually making it as a watermark. StreamReader reader = new StreamReader(Server.MapPath("sample.jpg")); Bitmap bi = new Bitmap(reader.BaseStream); // base image Graphics gr = Graphics.FromImage(bi); string customString = "your string goes here"; gr.DrawString(s, new Font("Cooper Black", 25), Brushes.ForestGreen, new PointF(140, 115)); … Continue reading Put watermarks on uploaded images–ASP.NET

checked and unchecked keywords in C#

This post explains about checked and unchecked keywords in C#. In arithmetic calculations when constants are involved compiler detects the overflows in the data types. For example look at the following code. 1: // int range is from -2,147,483,648 to 2,147,483,647 2: int i = 2147483647 + 10; The above will generate a compile time … Continue reading checked and unchecked keywords in C#

Charting with DotNet HighCharts

This post explains how to use the DotNet HighCharts wrapper for the HighCharts Javascript library. You can download the wrapper from Codeplex. First create an ASP,NET file and add the following Javascript references. 1: <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js”></script&gt; 1:  2: <script src=”http://code.highcharts.com/highcharts.js”&gt; 1: </script> 2: <script src=”http://code.highcharts.com/modules/exporting.js”&gt; </script> Download the wrapper and add the single .dll … Continue reading Charting with DotNet HighCharts

Detecting the Windows Phone Theme Background Color

We often need to detect the WP background theme color to switch the color schemes of our apps. This is very useful when we utilize the application bar and have some metro icons in our app. In built WP apps have this feature and switch between different icons. For example when you use the Messaging … Continue reading Detecting the Windows Phone Theme Background Color