The difference between Margin and Padding properties

Margin and Padding are two similar layout concepts that are often confused. Margin represents the amount of space around the outside of the element. This space ensures that the Element has room between it and neighboring elements. Padding functions differently. It is present on elements that inherit from Control  and allows the control to specify an amount of space inside itself. This inner space separates the control from its own content.  Take for example the Button control. The space inside the Button, around its text, that prevents the Button‘s border from shrinking to the size of its contents. Take a look at the below diagram which illustartes the differenece more.



Change the ASP.Net version of a website on IIS6 using C#.Net

Sometimes, while creating a website pragmatically, you wish to change the ASP.Net version the site is using. The following function change the ASP.Net version a website is using to ASP.Net 2.0

public static void UpdateASPNetVersion(string siteidentifier, string virtualDirectoryName)
   //get virtual directory and site name for m context parameters
   string targetSite = "W3SVC/" + siteidentifier + "/ROOT";
   string targetVDir = virtualDirectoryName;
   Process process = new Process();
   //run the script
   process.StartInfo.FileName =         Path.GetDirectoryName(System.Environment.SystemDirectory) + @"\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe";
   process.StartInfo.Arguments = string.Format(" -s {0}/{1}", targetSite, targetVDir);
   process.StartInfo.CreateNoWindow = false;

You can of course change the ASP.Net version to any other version by choosing a different directory.