Saturday 15 September 2012

Jquery Everytime function

$(document).everyTime(5000, function () {

UpdateNews();

});

http://jquery.offput.ca/timers/

or

window.setInterval(function() {
    UpdateNews();
}, 50000);

Friday 14 September 2012

Reset form values with Javascript

$(this).closest('.form-container-table').find('input,textarea').val('')

Example:  <a onclick="$(this).closest('.form-container-table').find('input,textarea').val('')" href="javascript:;">RESET</a>

Thursday 13 September 2012

Fast search connector setup

PS C:\> .\securefastsearchconnector.ps1 -certPath .\FASTSearchCert.pfx -ssaName
"FASTContent" -userName "domain\MOSSDEV"

Thursday 6 September 2012

Problem with httpContext.RewritePath on IIS 7

<configuration>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
</system.webServer></configuration>

http://stackoverflow.com/questions/4976893/problem-with-httpcontext-rewritepath-on-iis-7

Tuesday 4 September 2012

How to remove illegal characters from a string?

public static string RemoveIllegalCharacters(string stringValue)
       {
           string pattern = @"[^\w\s\-\+]";
           string replacement = " ";
           string noResultText = "noresult";

           Regex regEx = new Regex(pattern);
           string sanitized = regEx.Replace(stringValue, replacement);
           if (!string.IsNullOrEmpty(sanitized.Trim()))
               return sanitized;
           else
               return noResultText;
       }