
Create an HTML Element and Hold it in a Reference Variable
When you create a new HTML element, you may want to keep its reference and later add a few more properties to it in the script. Just store it in

When you create a new HTML element, you may want to keep its reference and later add a few more properties to it in the script. Just store it in

The .NET System.Globalizaton’s NumberStyles has a parameter called AllowHexSpecifier that helps us to replace a hexString with RGB color. public static Color HexToColor(string hexString){ //replace # occurences if (hexString.IndexOf(‘#’) !=

To change the date format in C#, just use the ToUniverstalTime and the overload formatting as below: String isoFormat = inputDateTime.ToUniversalTime().ToString(“s”) + “Z”;

We can use the GetDistinaceTo?method of the GetCoordinates?class to determine the distance between two coordinates in C#. See below for an example: Using System.Device.Location;//double distance = 0.0;var aCoordinate = new

Elements that are added after initial page load through an DOM action do not have event handlers attached to them. We can use the live event handler to attach the

Via Java Reflection API, we can obtain all the annotations of a class as follows: Class clazz = Foo.class;Annotation[] clazzAnnotations = clazz.getAnnotations(); Related Articles Automation of Tasks Using Java Abstract

We use a lot of ng-templates in our HTML and have cases in which we would need to swap one with the other based on a condition. ngSwitch comes in

Use the System.Environment namespace’s GetFolderPath?method to retrieve the path of a special folder. It can also create the folder if it does not exist. System.Environment.GetFolderPath(Environment.SpecialFolder.Recent, Environment.SpecialFolderOption.None))

ASP.NET core has inbuilt methods to return few standard response codes. Here is an example. [HttpGet] public IActionResult CustomStatusCode() { //code return BadRequest; //sends status code 400 }