<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:snippet="http://codexchange.org/schemas/snippet/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>CodeXchange: User Contributed Snippets</title>
    <link>http://www.codexchange.org</link>
    <description>Summary of the snippets published by a codexchange user</description>
    <language>en-us</language>
    <copyright>Copyright © CodeXchange, 2004-2006</copyright>
    <generator>CodeXchange RSS Feed Generator v1.0</generator>
    <webMaster>webmaster@codexchange.org</webMaster>
    <lastBuildDate>Thu, 15 Oct 2026 10:21:14 GMT</lastBuildDate>
    <ttl>20</ttl>
    <dc:language>en-us</dc:language>
    <dc:rights>Copyright © CodeXchange, 2004-2006</dc:rights>
    <dc:date>10/15/2026 10:21:14 AM</dc:date>
    <dc:publisher />
    <dc:creator>CodeXchange RSS Feed Generator v1.0</dc:creator>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=263de6fe-e227-4752-849a-1778fe111401</guid>
      <title>Return multiple checkbox selections seperated by a comma</title>
      <link>/PreviewSnippet.aspx?SnippetID=263de6fe-e227-4752-849a-1778fe111401</link>
      <description>Return multiple checkbox selections seperated by a comma [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 21 Mar 2007 13:43:38 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=263de6fe-e227-4752-849a-1778fe111401#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>Return multiple checkbox selections seperated by a comma</dc:title>
      <dc:date>3/21/2007 1:43:38 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>private string chkBox(CheckBoxList c)
{
       string sItem = "";
       for(int i=0;i < c.Items.Count; i++)
       {
               if (c.Items[i].Selected == true)
              {
                     if (sItem == "")
                     {
                            sItem = c.Items[i].Value;
                     }
                            else
                     {
                            sItem = sItem + "," + c.Items[i].Value;
                     }
              }
       }
       return sItem;
}
		
Call like this:
chkBox(checkboxName).ToString() will give a string of selections seperated by ",".</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=9a716902-fb3a-4bf4-b9fc-1f70fd93d4e8</guid>
      <title>Clear all text boxs , radio buttons and check boxs on a web page</title>
      <link>/PreviewSnippet.aspx?SnippetID=9a716902-fb3a-4bf4-b9fc-1f70fd93d4e8</link>
      <description>Clear all text boxs , radio buttons and check boxs on a web page [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 21 Mar 2007 13:48:51 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=9a716902-fb3a-4bf4-b9fc-1f70fd93d4e8#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>Clear all text boxs , radio buttons and check boxs on a web page</dc:title>
      <dc:date>3/21/2007 1:48:51 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>Contain all controls in a single panel ex: pnlBody
/// <summary>
/// Method will clear all textbox, radiobuttons and checkboxs
/// Had to
/// </summary>
		
private void ClearTextBoxs()
{ 
	foreach (Control c in this.pnlBody.Controls)
	{
                               //Clear text boxs
		if (c is TextBox)
		{
			TextBox tb = (TextBox)c;
			tb.Text = string.Empty;
		}
                               //Clear checkbox list
		if(c is CheckBoxList)
		{
			CheckBoxList cb = (CheckBoxList)c;
			cb.ClearSelection();
		}
                               //Clear radio button list
		if(c is RadioButtonList)
		{
			RadioButtonList rb = (RadioButtonList)c;
			rb.ClearSelection();
		}
	} 
}
</pre>]]></content:encoded>
      <snippet:downloads>2</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=a68cbde9-65d0-4de4-9af7-2aa0d22f3cfc</guid>
      <title>Simple and secure password generation</title>
      <link>/PreviewSnippet.aspx?SnippetID=a68cbde9-65d0-4de4-9af7-2aa0d22f3cfc</link>
      <description>Simple and secure password generation [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 21 Mar 2007 13:51:51 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=a68cbde9-65d0-4de4-9af7-2aa0d22f3cfc#comments</comments>
      <category>de2012da-757e-4af6-8537-6799adb7bce1</category>
      <dc:title>Simple and secure password generation</dc:title>
      <dc:date>3/21/2007 1:51:51 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>The simplest random password generation scheme with ASP.NET is to return a portion of a GUID. A GUID is a Globally Unique ID, a 128-bit number that can be quickly generated with one method call, producing a hexidecimal string that can be used as a random password. To create a new GUID, use the System.Guid structure's NewGuid() method. Then, the .ToString() method can be used to create a string version of this. Here's some example code:
Result = System.Guid.NewGuid().ToString();</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=c52f008d-7fc8-4dbc-970b-42f215c2b777</guid>
      <title>Javascript to close a popup and refresh the parent window</title>
      <link>/PreviewSnippet.aspx?SnippetID=c52f008d-7fc8-4dbc-970b-42f215c2b777</link>
      <description>Javascript to close a popup and refresh the parent window [HTML &amp; Javascript]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 21 Mar 2007 14:07:07 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=c52f008d-7fc8-4dbc-970b-42f215c2b777#comments</comments>
      <category>de2012da-757e-4af6-8537-6799adb7bce1</category>
      <dc:title>Javascript to close a popup and refresh the parent window</dc:title>
      <dc:date>3/21/2007 2:07:07 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre><script type="text/javascript">
funtion closeMe()
{
window.opener.location.href = window.opener.location.href;closeWindow();
}
function closeWindow() 
{
window.open('','_parent','');
window.close();
}
</script>

#######################################################
Call the closeMe() function in the popup window and parent window will be updated, then  popup will closed. Works in Fireworks.</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>HTML &amp; Javascript</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=54eb0809-4348-4f50-a30f-558fce5995d7</guid>
      <title>Set Textbox focus</title>
      <link>/PreviewSnippet.aspx?SnippetID=54eb0809-4348-4f50-a30f-558fce5995d7</link>
      <description>Set Textbox focus [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 28 Jun 2006 14:34:57 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=54eb0809-4348-4f50-a30f-558fce5995d7#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>Set Textbox focus</dc:title>
      <dc:date>6/28/2006 2:34:57 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>/// <summary>
/// Set focus to a control, passed in by txtbox id
/// </summary>
/// <param name="txtbox">textbox id that has foucus set to</param>
private void SetFocus(string txtbox)
		{
			//Set focus to a control, passed in be string txtbox
			
			System.Text.StringBuilder sb = new System.Text.StringBuilder("");

			sb.Append("<script language=\"JavaScript\">");
			sb.Append(" document.forms[0].item(\"" + txtbox + "\").focus()");
			sb.Append("</script>");

			if (!IsStartupScriptRegistered("setFocus"))
			{
				RegisterStartupScript("setFocus", sb.ToString());
			}
		}
		

Call method with control name like this

SetFocus("some control");</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=ad3d6ec0-4127-4e14-ae39-8fc3e266eb00</guid>
      <title>Filling a DataSet with a Sproc &amp; getting connection string from web.config</title>
      <link>/PreviewSnippet.aspx?SnippetID=ad3d6ec0-4127-4e14-ae39-8fc3e266eb00</link>
      <description>Filling a DataSet with a Sproc &amp; getting connection string from web.config [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Thu, 08 Jun 2006 13:31:22 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=ad3d6ec0-4127-4e14-ae39-8fc3e266eb00#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>Filling a DataSet with a Sproc &amp; getting connection string from web.config</dc:title>
      <dc:date>6/8/2006 1:31:22 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>//"Conn" is in web.config
//configuration>
//appSettings>
//add key="Conn" value="connection string"/>
SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["Conn"]);

try 
{
conn.Open();
SqlCommand cmd = new SqlCommand("sp_Your_Procedure", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adapter.Fill(ds);
this.myDataGrid.DataSource = ds;
this.myDataGrid.DataBind();
}
catch(Exception ex) 
{
Response.Write(ex.message);
//Do something with Exception
}</pre>]]></content:encoded>
      <snippet:downloads>1</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=694df4cc-59a0-47a7-b2e4-99d9e10978f5</guid>
      <title>Dynamic page help user control, using a db for text retrieval</title>
      <link>/PreviewSnippet.aspx?SnippetID=694df4cc-59a0-47a7-b2e4-99d9e10978f5</link>
      <description>Dynamic page help user control, using a db for text retrieval [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 25 Apr 2007 13:25:38 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=694df4cc-59a0-47a7-b2e4-99d9e10978f5#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>Dynamic page help user control, using a db for text retrieval</dc:title>
      <dc:date>4/25/2007 1:25:38 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>A user control that allows you to add an icon on a page. When clicked, a block of text opens with information or help. This comes from a db table so any number of pages or sections can be supplied with dynamic help.
///User Control registration, with help id
	
	<uc1:helpText id="HelpText1" runat="server" HelpID="default.aspx"></uc1:helpText>
	
	
	//User Control html and javascript
	
	<script language="javascript">
	<!--
		function showHelp(input)
		{
			var objDiv = document.getElementById("HelpText1_helpResult");
			if(input==1)
				
				objDiv.style.display="block";
			else
				objDiv.style.display="none";
				
		}
	//-->
	</script>
	<div align="center"><img src='<% =ConfigurationSettings.AppSettings["siteURL"] %>/includes/question.gif' onmousedown='javascript:showHelp(1);' onmouseup='javascript:showHelp(0);'
			align='text-top'></div>
	<div id="helpError" class="helpText" runat="server"></div>
<div id="helpResult" class="helpText" runat="server"></div>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/// Code behind file
	
	
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.Data.SqlClient; 
	using System.Configuration;
	public class helpText : System.Web.UI.UserControl
	{
		/// <summary>
		/// Help Results 
		/// </summary>
		protected System.Web.UI.HtmlControls.HtmlGenericControl helpResult;
		/// <summary>
		/// Help Error ID
		/// </summary>
		protected System.Web.UI.HtmlControls.HtmlGenericControl helpError;
		private string id;
		public string HelpID { get { return id; } set { id = value; } }
		private void Page_Load(object sender, System.EventArgs e)
		{
			loadHelpText(HelpID);
			// Put user code to initialize the page here
		}
		private void loadHelpText(string pageName)
		{
			System.Text.StringBuilder strResult = new System.Text.StringBuilder();
			// specify the SELECT statement to extract the data
			string strSelect = "sp_GetHelpText";
			try
			{
				// create a new Connection object using the connection string
				SqlConnection objConnect = new SqlConnection(ConfigurationSettings.AppSettings["conn"]);
				// open the connection to the database
				objConnect.Open();
				// create a new Command using the connection object and select statement
				SqlCommand objCommand = new SqlCommand();
				objCommand.Connection=objConnect;
				objCommand.CommandType=CommandType.StoredProcedure;
				objCommand.CommandText=strSelect;
				// add the parameter to pass the helpTextID
				SqlParameter myParm1 = objCommand.Parameters.Add("@PageName", SqlDbType.VarChar,100);
				myParm1.Value = pageName;
				SqlParameter rtCode = objCommand.Parameters.Add(new SqlParameter("@rtCode", SqlDbType.Int));
				rtCode.Direction = ParameterDirection.ReturnValue;
				//Failure = -1
				if(rtCode.Equals(-1))
				{
					throw new Exception();
				}
				// declare a variable to hold a DataReader object
				SqlDataReader objDataReader;
				// execute the SQL statement against the command to fill the DataReader
				objDataReader = objCommand.ExecuteReader();
				// iterate through the records in the DataReader getting field values
				// the Read method returns False when there are no more records
				while (objDataReader.Read())
				{
					strResult.Append ( "<center><u>" );
					strResult.Append ( objDataReader["HelpTitle"].ToString());
					strResult.Append ( "</u></center>" );
					strResult.Append ( "<br />" );
					strResult.Append ( objDataReader["HelpText"].ToString()); 
				}
				// close the DataReader and Connection
				objDataReader.Close();
				objConnect.Close();
			}
			catch (Exception objError)
			{
				// display error details
				helpError.InnerHtml = "<b>* Error while accessing data</b>.<br />"
					+ objError.Message + "<br />" + objError.Source;
				return;   //  and stop execution
			}
			// add closing table tag and display the results
			helpResult.InnerHtml = strResult.ToString();
		}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
///DB Scripts
// Stored Procedure - sp_GetHelpText
create procedure dbo.sp_GetHelpText
@PageName varchar(100)
as
DECLARE @rtCode int
set nocount on
IF EXISTS(SELECT HelpID FROM tblHelpText WHERE PageName = @PageName)
BEGIN
	SELECT * FROM tblHelpText WHERE PageName = @PageName
	
	SET @rtCode = 0
END
ELSE
BEGIN
	SET @rtCode = -1
END
PRINT @rtCode
RETURN @rtCode
GO
//Table Script
/****** Object:  Table [dbo].[tblHelpText]    Script Date: 4/25/2007 10:18:41 AM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblHelpText]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblHelpText]
GO
/****** Object:  Table [dbo].[tblHelpText]    Script Date: 4/25/2007 10:18:42 AM ******/
CREATE TABLE [dbo].[tblHelpText] (
	[HelpID] [int] NOT NULL ,
	[PageName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[HelpTitle] [nvarchar] (400) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[HelpText] [nvarchar] (4000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
GO</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=05682994-a3f5-4df8-80ec-a19b5f1285b9</guid>
      <title>Check if a string is a number</title>
      <link>/PreviewSnippet.aspx?SnippetID=05682994-a3f5-4df8-80ec-a19b5f1285b9</link>
      <description>Check if a string is a number [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Thu, 08 Jun 2006 13:45:47 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=05682994-a3f5-4df8-80ec-a19b5f1285b9#comments</comments>
      <category>7b219e80-542a-4062-9dbf-c3c9b121b6a8</category>
      <dc:title>Check if a string is a number</dc:title>
      <dc:date>6/8/2006 1:45:47 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>/// <summary>
/// Check to see if string Is A Number
/// </summary>
/// <param name="i">String number to check</param>
/// <returns>bool - true if string is a real number</returns>
private bool IAN(string i)
{
	try
	{
		int.Parse(i);
	}
	catch
	{
		return false;
	}
	return true;
}</pre>]]></content:encoded>
      <snippet:downloads>1</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=6b5b5793-aca2-4dea-ac87-a77202b94ed9</guid>
      <title>Close a browser window</title>
      <link>/PreviewSnippet.aspx?SnippetID=6b5b5793-aca2-4dea-ac87-a77202b94ed9</link>
      <description>Close a browser window [HTML &amp; Javascript]</description>
      <author>Greg Gamble</author>
      <pubDate>Mon, 12 Jun 2006 17:35:56 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=6b5b5793-aca2-4dea-ac87-a77202b94ed9#comments</comments>
      <category>205504bb-6ee2-4a2c-a925-c2d480f5977a</category>
      <dc:title>Close a browser window</dc:title>
      <dc:date>6/12/2006 5:35:56 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>For .NET 1.1: 
<asp:LinkButton ID="lnk" runat="server" />
Add this 
lnk.Attributes.Add("onClick", "document.window.close();")</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>HTML &amp; Javascript</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=f71c29a0-68c2-4b75-9253-bc7f14275e70</guid>
      <title>Populate dropdown using a sproc and a data reader/datareader</title>
      <link>/PreviewSnippet.aspx?SnippetID=f71c29a0-68c2-4b75-9253-bc7f14275e70</link>
      <description>Populate dropdown using a sproc and a data reader/datareader [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 28 Jun 2006 14:45:05 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=f71c29a0-68c2-4b75-9253-bc7f14275e70#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>Populate dropdown using a sproc and a data reader/datareader</dc:title>
      <dc:date>6/28/2006 2:45:05 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>		/// <summary>
		/// Populate dropdown using a sproc and a data reader
		/// </summary>
		private void GetDropDownData()
	{			
			//Load Connection String from web.config file
			SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["Conn"]);

			try 
			{
				conn.Open();
				SqlCommand cmd = new SqlCommand("sp_YourSproc", conn);
				cmd.CommandType = CommandType.StoredProcedure;
			
				SqlDataReader reader = cmd.ExecuteReader();
				this.DropDownList.DataSource = reader;
				this.DropDownList.DataValueField = "ID";
				this.DropDownList.DataTextField = "Name";
				this.DropDownList.DataBind()
				//Add a default value;
				this.Items.Insert(0, "Make a selection");

			}
			catch(Exception ex) 
			{
				//Add some good exception handling
				Response.Write(ex.Message);
			}

	}</pre>]]></content:encoded>
      <snippet:downloads>2</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=da7c9fa1-ae1e-44a4-8213-c49212140631</guid>
      <title>Bind an enum to a combobox</title>
      <link>/PreviewSnippet.aspx?SnippetID=da7c9fa1-ae1e-44a4-8213-c49212140631</link>
      <description>Bind an enum to a combobox [C#]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 21 Mar 2007 13:56:58 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=da7c9fa1-ae1e-44a4-8213-c49212140631#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>Bind an enum to a combobox</dc:title>
      <dc:date>3/21/2007 1:56:58 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>public enum MyEnum
{
Me, MySelf, Irene
}
this.comboBox1.DataSource = System.Enum.GetValues(typeof(MyEnum));
</pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>C#</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=bf79911c-1993-4e96-8564-c5ec39ab1fb8</guid>
      <title>Close a browser window - works with FireFox !!</title>
      <link>/PreviewSnippet.aspx?SnippetID=bf79911c-1993-4e96-8564-c5ec39ab1fb8</link>
      <description>Close a browser window - works with FireFox !! [HTML &amp; Javascript]</description>
      <author>Greg Gamble</author>
      <pubDate>Thu, 06 Jul 2006 12:48:20 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=bf79911c-1993-4e96-8564-c5ec39ab1fb8#comments</comments>
      <category>5c13f9b1-b6fb-4509-aa9f-3281a114a487</category>
      <dc:title>Close a browser window - works with FireFox !!</dc:title>
      <dc:date>7/6/2006 12:48:20 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre>Insert the following JS into head of page to close:
<script language="javascript" type="text/javascript">
function closeWindow()
{
window.open('','_parent','');
window.close(); 
}
</script> 

Use this link:
<a href="javascript:closeWindow();">Close Window</a></pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>HTML &amp; Javascript</snippet:language>
    </item>
    <item>
      <guid>/PreviewSnippet.aspx?SnippetID=eaa388ec-6f85-4858-9042-d2d01ca03c84</guid>
      <title>Javascript that will allow text box entry by selected key board keys  ... Validation</title>
      <link>/PreviewSnippet.aspx?SnippetID=eaa388ec-6f85-4858-9042-d2d01ca03c84</link>
      <description>Javascript that will allow text box entry by selected key board keys  ... Validation [HTML &amp; Javascript]</description>
      <author>Greg Gamble</author>
      <pubDate>Wed, 21 Mar 2007 13:54:18 GMT</pubDate>
      <comments>/PreviewSnippet.aspx?SnippetID=eaa388ec-6f85-4858-9042-d2d01ca03c84#comments</comments>
      <category>aeb15495-509d-43ee-9bb5-f59c47bca5ff</category>
      <dc:title>Javascript that will allow text box entry by selected key board keys  ... Validation</dc:title>
      <dc:date>3/21/2007 1:54:18 PM</dc:date>
      <dc:creator>Greg Gamble</dc:creator>
      <content:encoded><![CDATA[<pre><html>
<head>
<script language='JavaScript'>
function checkKey(e) {
        var key = e.which || e.keyCode; // NS vs. IE
        // allow digits, decimal, tab, backspace, return
        if (
                        (       key != 8
                        && key != 9
                        && key != 13
                        && key != 46
                        )
                        && (key < 48 || key > 57)
        ) { return false; }
}
</script>
</head>
<body>
	<h3>type a number (decimals OK)</h3>
	<form>
		<input type='text' size='3' maxlength='4' name='num' onKeyPress='return checkKey(event);' />
	</form>
</body>
</html></pre>]]></content:encoded>
      <snippet:downloads>0</snippet:downloads>
      <snippet:rating>0</snippet:rating>
      <snippet:language>HTML &amp; Javascript</snippet:language>
    </item>
  </channel>
</rss>