This post describes integrating Lync status into an ASP.Net Gridview. I had a bit of a nightmare trying to achieve this so that it worked on IE8 all the way up to IE11 . First I had it working on … Continue reading →
Description: Useful when we want to wait for a process to complete until we continue execution of a script. Source: NA Script: This script waits until notepad.exe and iexplore.exe are no longer running: dim svc : set svc=getobject(“winmgmts:root\cimv2”) dim sQuery : … Continue reading →
This is a quick example of how to create a custom debug log file in an ASP.Net class which you can use in your website. If the file doesn’t exist, it creates it. It names the file today’s date. And … Continue reading →
If you just want to read your Session State from an ASHX or HttpHandler, you need to implement IReadOnlySessionState. If you want to write to your Session State, you must implement IRequiresSessionState. Note that you will also need use the System.Web.SessionState namespace. This post … Continue reading →
I recently needed to generate a Windows Installer transform file (MST) using PowerShell. I’ve ripped out some excerpts below to demonstrate inserting rows, querying tables, retrieving properties and generating a transform. Using this example for reference, you should be able … Continue reading →
This post describes the process I use to strip out style attributes in HTML code using a regular expression. My website is presenting data from a field in SharePoint. This field uses HTML and CSS style attributes to construct the … Continue reading →
I have a GridView with hyperlinks in some of the columns, which open up a new page in a FancyBox. FancyBox is a pretty cool lightbox alternative. Anyway, in the FancyBox page content you can make changes which will affect values in … Continue reading →
We can detect if an ASP.Net form is valid from Javascript by using the following: if (typeof (Page_ClientValidate) == ‘function’) { Page_ClientValidate(); } if (Page_IsValid) { //form valid }
This post describes how detect for ASP.Net page postback from Javascript. I needed to know if it was the first launch of the page or a postback from Javascript. I did this by adding a hidden field to the page: … Continue reading →
This post describes how to prevent submitting an ASP.Net form twice. I stumbled across a rather neat and handy way to achieve this by the following: public void PreventMultipleClicks(Button button, Page page) { button.Attributes.Add(“onclick”, “if(Page_ClientValidate()){this.disabled=true;this.value=’Processing Request…’;” + page.ClientScript.GetPostBackEventReference(button, String.Empty).ToString() + … Continue reading →