This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //http://adambielecki.blogspot.co.uk/2013/05/exporting-data-to-excel-and-csv-in.html | |
| public void ExportClientsListToCSV() | |
| { | |
| StringWriter sw = new StringWriter(); | |
| sw.WriteLine("\"First Name\",\"Last Name\",\"Email\""); | |
| Response.ClearContent(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //To Inject JS after async postback | |
| ScriptManager.RegisterStartupScript(this, this.GetType(), "AlertMessage", "alert('Hello World');", true); | |
| //To Inject JS for multiple postbacks use ?? not tested. Maybe this has to be injected only once. | |
| ScriptManager.RegisterStartupScript(UpdatePanelName, typeof(string), "ShowPopup", "alert('Hello World');", true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use master; | |
| Go | |
| alter database [TestNew] set single_user with rollback immediate; | |
| GO | |
| alter database [TestNew] modify name = Test ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @function em($target, $context: $base-font-size) { | |
| @return ($target / $context) * 1em; | |
| } | |
| // Usage: | |
| font-size: em(18px); | |
| // Go up to 18 px font size when in a 14 px context | |
| font-size: em(18px, 14px); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Utility | |
| if (typeof Object.create !== 'function') { | |
| Object.create = function(obj) { | |
| function F() { }; | |
| F.prototype = obj; | |
| return new F(); | |
| }; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //http://www.codeproject.com/Tips/581356/Safe-Submit-Button | |
| <input type="submit" name="Submit" value="Submit" | |
| önclick = "this.value='Please wait...'; this.disabled=true; this.form.submit();" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Taken from: http://tutorialzine.com/2013/07/quick-tip-parse-urls/ | |
| $(function(){ | |
| // The URL we want to parse | |
| var url = 'http://tutorialzine.com/2013/07/quick-tip-parse-urls/?key=value#comments'; | |
| // The magic: create a new anchor element, and set the URL as its href attribute. | |
| // Notice that I am accessing the DOM element inside the jQuery object with [0]: | |
| var a = $('<a>', { href:url } )[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*For more details see http://encosia.com/using-jquery-to-consume-aspnet-json-web-services */ | |
| /*c# Method must be static and be decorated with [WebMethod] Attribute*/ | |
| $.ajax({ | |
| type: "POST", | |
| url: "Default.aspx/GetEvents", | |
| data: "{month : 1, year : 1}", | |
| //Or data: JSON.stringify({month:1}), | |
| contentType: "application/json; charset=utf-8", | |
| dataType: "json", //Return Type of data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--http://www.hanselman.com/blog/FallbackHTML5AudioTagsForASimpleMP3PodcastAreHarderThanYoudThink.aspx--> | |
| <script> | |
| <audio id="audioplayer" preload="auto" controls style="width:100%;" > | |
| <source src="your.mp3" type="audio/mp3"> | |
| Your browser doesn't support the HTML audio tag. You can still download the show, though! | |
| </audio> | |
| <p id="audioplayer_1"></p> | |
| <script type="text/javascript"> | |
| var audioTag = document.createElement('audio'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test |