XML Serialization quick and easy csharp

Serialization with XML and C# this is mainly here as a reminder for me on how to do it! To serialize to a file: using System.Xml; using System.Xml.Serialization; // other code List mylist = this.getList(); Type stype = typeof(List); var serializer = new XmlSerializer(stype); XmlWriterSettings settings = new XmlWriterSettings(); settings.OmitXmlDeclaration = true; // this is XML Serialization quick and easy csharp

Bootstrap compatible asp.net button

Similar to my previous post, you can use the following code to create a custom asp.net button with the ‘button’ tags used in HTML5 and bootstrap. [ParseChildren] public class bsButton : Button { private string _ButtonCss = “btn btn-default”; [Browsable(true), Description(“The css class”),] public string ButtonCss { get { return _ButtonCss; } set { _ButtonCss Bootstrap compatible asp.net button

Calculate a fraction in javascript

Calculating a fraction from a double in javascript The following code will allow you to calculate a fraction in javascript function getFraction(dblValue, dblTolerance) { var f0 = 1 / dblValue; var f1 = 1 / (f0 – Math.floor(f0)); var a_t = Math.floor(f0); var a_r = Math.round(f0); var b_t = Math.floor(f1); var b_r = Math.round(f1); var Calculate a fraction in javascript

Javascript Dynamic Event

Javascript Dynamic Events / Javascript Custom Events I often asked myself: How do I create a custom event in javascript? Something I have been using for quite awhile now is my own custom event handler for javascript, it’s pretty simple compact and easy to use To use; just copy the devent function to the page Javascript Dynamic Event