“Save As” Dialog Box for Streaming File

To download files using a “Save As” dialog box try this code:         Select Case FileExt            Case “gif” ContentType = “image/gif”            Case “tif” ContentType = “image/tiff”            Case “jpg” ContentType = “image/jpeg”            Case “pdf” ContentType = “application/pdf”            Case “avi” ContentType = “video/x-msvideo”            Case “mp3” ContentType = “audio/mpeg”            Case “mpg” ContentType = “video/mpeg”            Case “wav” ContentType = “audio/wav”            Case “rar” ContentType = “application/x-rar-compressed”            Case “zip” ContentType = “application/x-zip-compressed”            Case […]

Force SSL ON or OFF Function

When working on a site that may have some pages in SSL (the check out pages) and most pages not I use a function to switch between SSL and Non SSL pages. First, I set the non secure and SSL URL’s in the config file under appSettings:     <add key=”SSLURL” value=”https://www.mydomain.com”/>    <add key=”NonSSLURL” value=”http://www.mydomain.com”/> Next, in […]

JavaScript Code To Toggle Check Boxes

Here is some JavaScript code to toggle check boxes (same action as radio buttons). In the page load event register the JavaScript:    chkTwoYear.Attributes.Add(“onclick”, “javascript: CheckTwoProgram(” + chkTwoYear.ClientID + “);”);    chkFourYear.Attributes.Add(“onclick”, “javascript: CheckFourProgram(” + chkFourYear.ClientID + “);”); In the HTML of the page add the JavaScript: <SCRIPT Language=”JavaScript”><!– function CheckTwoProgram(id) {    if(id.checked)       document.forms[0].chkFourYear.checked=false;    } function CheckFourProgram(id) {    if(id.checked)       document.forms[0].chkTwoYear.checked=false;    } //–> </SCRIPT>

SPF Record

SPF is Sender Policy Framework. This is a tool to help fight spam by validating the from address of emails. When an email is received by an email server the sending domain can be checked for proper origination. Here is a sample rule in DNS: v=spf1 ip4:67.169.211.46 mx ptr -all Here is a tool to validate the […]

CSS Page Break with IE 7

To force a page break when printing the style=”page-break-before: always;” can be added. But this doesn’t always work with IE 7. For some reason IE 7 would ignore this. Probably because of the new print preview and “size to fit”. The simple fix to get IE 7 to recognize the page break just add something to […]

Email Encoder

When putting email addresses on a web page it is recommended to encode them. There are many web crawlers scanning pages to harvest email addresses. Here is an easy to use tool to encode the email address.          http://www.wbwip.com/wbw/emailencoder.html