Remove JavaScript Tags From HTML

After a while of trying to create the perfect regular expression that would remove script tags from HTML I came across this super simple regular expression. It goes to show you, sometimes the simplest things work best.

s = Regex.Replace(s, "", "",RegexOptions.Singleline|RegexOptions.IgnoreCase);


Looping Through a Directory And Its Files

A simple function to sift through all the files in a directory using .net

Private Function getEntries(ByVal dir As String)
Dim strEntry As String
Dim dirInfo As New DirectoryInfo(dir)
Dim strEntries As String() = Directory.GetFileSystemEntries(dirInfo.FullName)
     For Each strEntry In strEntries
          If (Directory.Exists(strEntry)) Then
            End If
Return 0
End Function

Applying Simple Ajax Functionality On Visual Studio

Here are the simple steps to applying ajax functionality to an aspx page using the UpdatePanel control.

  1. Drag and drop a ScriptManager item from the Ajax Extensions section on the toolbox onto the form you wish to add Ajax to.
  2. Drag and drop an UpdatePanel from the Ajax Extensions section on the toolbox onto the form you wish to add Ajax to.
  3. Drag and drop your form controls to the inside of the UpdatePanel.

It’s as simple as that. Here is what the code should look like on the Default.aspx page.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <asp:Label ID="lblMessage" runat="server" Text="Label"></asp:Label>
                <br />
                <asp:TextBox ID="txtMessage" runat="server"></asp:TextBox>
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" />

And here is what the code-behind page (Default.aspx.vb) should look like. Keep in mind this is a very simple example.

Partial Class _Default
    Inherits System.Web.UI.Page
    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        Me.lblMessage.Text = Me.txtMessage.Text
    End Sub
End Class

File Funnel

File Funnel is a small application I made that copies files of a specific extension from one directory and its sub-directories to another. It gives you the option to either copy just the files or the directory structure as well.

*It is built on VB.NET and requires the Microsoft .NET Framework so an additional download might be necessary. The application will direct you to the Microsoft download site for that.

Source @ GIT: