<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
  <channel>
    <title>CodeKeep ASP.NET Feed</title>
    <description>The latest and greatest ASP.NET code snippets publicly available</description>
    <link>http://www.codekeep.net/feeds.aspx</link>
    <lastBuildDate>Thu, 18 Oct 2012 14:36:32 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>RSS.NET: http://www.rssdotnet.com/</generator>
    <item>
      <title>Upload Control</title>
      <description>Description: Upload Control allows changing BROWSE... text and other customization.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/24070dd7-2c4d-4388-aa40-57d4639a0108.aspx'&gt;http://www.codekeep.net/snippets/24070dd7-2c4d-4388-aa40-57d4639a0108.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;/* THE CONTROL */
&amp;lt;%@ Control Language=&amp;quot;VB&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; CodeFile=&amp;quot;GTfileUpload.ascx.vb&amp;quot; Inherits=&amp;quot;Controls_GTfileUpload&amp;quot; %&amp;gt;
&amp;lt;asp:TextBox ID=&amp;quot;txtFile&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;
&amp;lt;asp:Button ID=&amp;quot;btn&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Browse&amp;quot; onclientclick=&amp;quot;javascript:browseFile()&amp;quot; /&amp;gt;
&amp;lt;asp:FileUpload ID=&amp;quot;fudFile&amp;quot; Style=&amp;quot;display:none&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;

/* THE CONTROL - CODE BEHIND */
Imports System.Data
Imports System.IO
Imports Dictionary ' This is a CUSTOM CLASS we have for converting words to other languages.
Partial Class Controls_GTfileUpload
    Inherits System.Web.UI.UserControl
' Code compiled and arranged by David Speight.
    ' Store property values.
    Private _enabled As Boolean
    Private _Language As String
    Private _ControlPrefix As String = &amp;quot;GTfileUpload$&amp;quot;
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        ' Use this control along with the function PostFile located in App_Code\Common\File.vb
        If (Page.IsStartupScriptRegistered(&amp;quot;onLoad&amp;quot;) = False) Then
            ' Be sure to SET the ControlPrefix value for this to work. VIEW SOURCE on the page you are loading to get the actual value .NET is using.
            Me.Page.RegisterStartupScript(&amp;quot;onLoad&amp;quot;, &amp;quot;&amp;lt;script language='javascript'&amp;gt;function browseFile() {document.getElementById('&amp;quot; &amp;amp; _ControlPrefix &amp;amp; &amp;quot;fudFile').click();}function setFile() {document.getElementById('&amp;quot; &amp;amp; _ControlPrefix &amp;amp; &amp;quot;txtFile').value = document.getElementById('&amp;quot; &amp;amp; _ControlPrefix &amp;amp; &amp;quot;fudFile').value;};&amp;lt;/script&amp;gt;&amp;quot;)
            ' Add the OnChange event to the hidden FileUpload control.
            fudFile.Attributes.Add(&amp;quot;onchange&amp;quot;, (_ControlPrefix &amp;amp; &amp;quot;txtFile.value = this.value;&amp;quot;))
        End If
    End Sub
#Region &amp;quot;Properties for: Controls&amp;quot;
    Public Property PostedFile() As String
        Get
            Return txtFile.Text.Trim()
        End Get
        Set(value As String)
            txtFile.Text = value
        End Set
    End Property
#End Region
#Region &amp;quot;Properties for Enabled &amp;amp; Visible&amp;quot;
    Public Property Enabled() As Boolean
        Get
            Return (_enabled)
        End Get
        Set(ByVal value As Boolean)
            _enabled = value
            txtFile.Enabled = value
            btn.Enabled = value
        End Set
    End Property
    Public Property ControlPrefix() As String
        Get
            Return (_ControlPrefix)
        End Get
        Set(ByVal value As String)
            _ControlPrefix = value
        End Set
    End Property
#End Region
#Region &amp;quot;Properties for Layout&amp;quot;
    Public Sub WidthSet(ByVal Width As Integer)
        txtFile.Width = Width
    End Sub
    Public Sub SetColorText(ByVal Color As Drawing.Color)
        txtFile.ForeColor = Color
    End Sub
    Public Sub SetColorBackground(ByVal Color As Drawing.Color)
        txtFile.BackColor = Color
    End Sub
    Public Sub SetColorButton(ByVal Color As Drawing.Color)
        btn.BackColor = Color
    End Sub
#End Region
#Region &amp;quot;Actons and Formatting&amp;quot;
    Public Sub LanguageSet(ByVal Language As String)
        Dim objDictionary As New Dictionary
        btn.Text = objDictionary.WordPhraseConvert(btn.Text, Language) &amp;amp; &amp;quot; ...&amp;quot;
    End Sub
#End Region
End Class

/* CUSTOM CLASS FILES TO BE USED WITH CONTROL */

Imports Microsoft.VisualBasic
Imports System
Imports System.IO
Imports System.IO.File
Imports System.Data
Imports System.Data.SqlClient

Public Class Files
 Public Function PostFile(ByVal TargetFileName As String, ByVal TargetPath As String, ByVal SourceFileName As String, ByVal SourcePath As String) As Boolean
        ' Add file Name to path, for instances where file+path may have been split up.
        SourcePath += SourceFileName
        TargetPath += TargetFileName
        If Not TargetFileName.Contains(&amp;quot;.&amp;quot;) Then
            ' Get File Extension.
            Dim ExtensionIndex As Integer = SourcePath.LastIndexOf(&amp;quot;.&amp;quot;)
            Dim FileExtension As String = &amp;quot;&amp;quot;
            Try
                FileExtension = Right(SourcePath, ExtensionIndex)
            Catch ex As Exception
                ' Do Nothing.
            End Try
            TargetPath += FileExtension
        End If
        ' Copy file.
        If File.Exists(SourcePath) Then
            File.Copy(SourcePath, TargetPath, True)
        End If
        ' Verifiy file copied.
        If File.Exists(TargetPath) Then
            ' Change modified date to current.
            Dim dtModified As DateTime
            dtModified = (Today &amp;amp; &amp;quot; &amp;quot; &amp;amp; TimeOfDay)
            File.SetLastWriteTime(TargetPath, dtModified)
            Return True
        Else
            Return False
        End If
    End Function
End Class




/* TEST PAGE USING CONTROL */

&amp;lt;%@ Page Language=&amp;quot;VB&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; CodeFile=&amp;quot;test.aspx.vb&amp;quot; Inherits=&amp;quot;test&amp;quot; %&amp;gt;
&amp;lt;%@ Register src=&amp;quot;~/Controls/GTfileUpload.ascx&amp;quot; tagname=&amp;quot;GTfileUpload&amp;quot; tagprefix=&amp;quot;gt4&amp;quot; %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;
&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;    
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;

       &amp;lt;gt4:GTfileUpload ID=&amp;quot;GTfileUpload1&amp;quot; runat=&amp;quot;server&amp;quot; ValidationGroup=&amp;quot;A&amp;quot; /&amp;gt;&amp;amp;nbsp;
       &amp;lt;asp:Button ID=&amp;quot;btnSave&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Upload&amp;quot; /&amp;gt;
       &amp;lt;br /&amp;gt;
    &amp;lt;asp:Label ID=&amp;quot;lblFileName&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Not Clicked Yet&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

/* TEST PAGE USING CONTROL - CODE BEHIND */

Imports Microsoft.VisualBasic
Imports System.Data
Imports Files

Partial Class test
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            GTfileUpload1.LanguageSet(&amp;quot;de&amp;quot;)
        End If
    End Sub
    Protected Sub btnSave_Click(sender As Object, e As System.EventArgs) Handles btnSave.Click
        Dim objFiles As New Files
        If (GTfileUpload1.PostedFile.Length &amp;gt; 0) Then
            lblFileName.Text = objFiles.PostFile(&amp;quot;DaveTest&amp;quot;, &amp;quot;D:\Test\&amp;quot;, &amp;quot;&amp;quot;, GTfileUpload1.PostedFile)
        End If
    End Sub
End Class

&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/24070dd7-2c4d-4388-aa40-57d4639a0108.aspx</link>
      <pubDate>Thu, 18 Oct 2012 14:36:32 GMT</pubDate>
    </item>
    <item>
      <title>Run Batch file from .net</title>
      <description>Description: Run Any Batchfile from .net code&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/016a9032-8201-41de-87a3-9f404e92b520.aspx'&gt;http://www.codekeep.net/snippets/016a9032-8201-41de-87a3-9f404e92b520.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;        Process p = new Process();
        p.StartInfo.FileName = Server.MapPath(&amp;quot; file Path &amp;quot;) + &amp;quot;filename.bat&amp;quot;;
        p.StartInfo.WorkingDirectory = Path.GetDirectoryName(Server.MapPath(&amp;quot; File Path &amp;quot;));
        p.StartInfo.UseShellExecute = false;

        // Run the process and wait for it to complete
        p.Start();
        p.WaitForExit();&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/016a9032-8201-41de-87a3-9f404e92b520.aspx</link>
      <pubDate>Mon, 08 Oct 2012 04:11:32 GMT</pubDate>
    </item>
    <item>
      <title>How to validate field inside a gridview and show errors in message box.</title>
      <description>Description: hi i have gridview ,i want to validate all the field inside gridview 
 
my grid view as &lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/28a3eae5-2c34-4edd-b7d8-81ba21fdb1ec.aspx'&gt;http://www.codekeep.net/snippets/28a3eae5-2c34-4edd-b7d8-81ba21fdb1ec.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;  &amp;lt;asp:GridView ID=&amp;quot;GridView1&amp;quot; runat=&amp;quot;server&amp;quot; AllowPaging=&amp;quot;True&amp;quot; AutoGenerateColumns=&amp;quot;False&amp;quot;
                                                                                  CssClass=&amp;quot;GridStyle&amp;quot;
                                                                                    DataKeyNames=&amp;quot;ID&amp;quot; DataSourceID=&amp;quot;SqlDataSource1&amp;quot; Font-Names=&amp;quot;Tahoma&amp;quot; Font-Size=&amp;quot;11px&amp;quot;
                                                                                    HeaderStyle-CssClass=&amp;quot;HeaderStyle&amp;quot; HorizontalAlign=&amp;quot;Left&amp;quot; OnDataBound=&amp;quot;gvApplication_DataBound&amp;quot;
                                                                                    OnPageIndexChanging=&amp;quot;gvApplication_PageIndexChanging&amp;quot; OnRowCancelingEdit=&amp;quot;gvApplication_RowCancelingEdit&amp;quot;
                                                                                    OnRowCommand=&amp;quot;gvApplication_RowCommand&amp;quot; OnRowCreated=&amp;quot;gvApplication_RowCreated&amp;quot;
                                                                                    OnRowDataBound=&amp;quot;gvApplication_RowDataBound&amp;quot; OnRowDeleted=&amp;quot;gvApplication_RowDeleted&amp;quot;
                                                                                    OnRowEditing=&amp;quot;gvApplication_RowEditing&amp;quot; OnRowUpdated=&amp;quot;gvApplication_RowUpdated&amp;quot;
                                                                                    OnRowUpdating=&amp;quot;gvApplication_RowUpdating&amp;quot; Width=&amp;quot;100%&amp;quot;&amp;gt;
                                                                                    &amp;lt;%--&amp;lt;RowStyle BorderColor=&amp;quot;Silver&amp;quot; BorderStyle=&amp;quot;Solid&amp;quot; BorderWidth=&amp;quot;1px&amp;quot; ForeColor=&amp;quot;Blue&amp;quot;
                                                            Wrap=&amp;quot;True&amp;quot; /&amp;gt;--%&amp;gt;
                                                                                    &amp;lt;Columns&amp;gt;
                                                                                     
                                                                                             &amp;lt;asp:CommandField 
                       ShowEditButton=&amp;quot;True&amp;quot; CausesValidation=&amp;quot;true&amp;quot; ValidationGroup=&amp;quot;ValGrpEdit&amp;quot;&amp;gt;&amp;lt;/asp:CommandField&amp;gt;
                                                                                             
                                                                                      
                                                                                        &amp;lt;asp:TemplateField ShowHeader=&amp;quot;False&amp;quot;&amp;gt;
                                                                                            &amp;lt;ItemTemplate&amp;gt;
                                                                                                &amp;lt;asp:LinkButton ID=&amp;quot;lnkDelete&amp;quot; runat=&amp;quot;server&amp;quot; CausesValidation=&amp;quot;False&amp;quot; 
                                                                                                    CommandName=&amp;quot;Delete&amp;quot; Text=&amp;quot;Delete&amp;quot;&amp;gt;&amp;lt;/asp:LinkButton&amp;gt;
                                                                                            &amp;lt;/ItemTemplate&amp;gt;
                                                                                        &amp;lt;/asp:TemplateField&amp;gt;
                                                                                
                                                                                        &amp;lt;asp:TemplateField HeaderText=&amp;quot;Name&amp;quot; SortExpression=&amp;quot;Name&amp;quot;&amp;gt;
                                                                                            &amp;lt;EditItemTemplate&amp;gt;
                                                                                                &amp;lt;asp:TextBox ID=&amp;quot;Name1&amp;quot; runat=&amp;quot;server&amp;quot; CssClass=&amp;quot;text&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;Name&amp;quot;) %&amp;gt;'
                                                                                                    ValidationGroup=&amp;quot;ValGrpEdit&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                                                                                                &amp;lt;asp:RequiredFieldValidator ID=&amp;quot;RequiredName&amp;quot; runat=&amp;quot;server&amp;quot; ControlToValidate=&amp;quot;Name1&amp;quot;
                                                                                                    ErrorMessage=&amp;quot;Please enter a valid Name.&amp;quot;  EnableClientScript=&amp;quot;true&amp;quot; ValidationGroup=&amp;quot;ValGrpEdit&amp;quot; Width=&amp;quot;16px&amp;quot;&amp;gt;*&amp;lt;/asp:RequiredFieldValidator&amp;gt;
                                                                                            &amp;lt;/EditItemTemplate&amp;gt;
                                                                                            &amp;lt;ItemTemplate&amp;gt;
                                                                                                &amp;lt;asp:Label ID=&amp;quot;Name2&amp;quot; runat=&amp;quot;server&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;Name&amp;quot;) %&amp;gt;'&amp;gt;&amp;lt;/asp:Label&amp;gt;
                                                                                            &amp;lt;/ItemTemplate&amp;gt;
                                                                                            &amp;lt;ItemStyle ForeColor=&amp;quot;Black&amp;quot; Width=&amp;quot;15%&amp;quot; /&amp;gt;
                                                                                            &amp;lt;ControlStyle /&amp;gt;
                                                                                        &amp;lt;/asp:TemplateField&amp;gt;
                                                                          
                                                                                        &amp;lt;asp:TemplateField HeaderText=&amp;quot;Support Owner ID&amp;quot; SortExpression=&amp;quot;SupportOwnerIDSort&amp;quot;&amp;gt;
                                                                                            &amp;lt;ItemTemplate&amp;gt;
                                                                                                &amp;lt;div style=&amp;quot;text-align: left; margin-removed 5px; margin-removed 5px;&amp;quot;&amp;gt;
                                                                                                    &amp;lt;asp:Label ID=&amp;quot;SupportOwnerID2&amp;quot; runat=&amp;quot;server&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;SupportOwnerID&amp;quot;) %&amp;gt;'&amp;gt;&amp;lt;/asp:Label&amp;gt;
                                                                                                &amp;lt;/div&amp;gt;
                                                                                            &amp;lt;/ItemTemplate&amp;gt;
                                                                                            &amp;lt;EditItemTemplate&amp;gt;
                                                                                                &amp;lt;asp:TextBox ID=&amp;quot;SupportOwnerID1&amp;quot;  ValidationGroup=&amp;quot;ValGrpEdit&amp;quot; runat=&amp;quot;server&amp;quot; CssClass=&amp;quot;text&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;SupportOwnerID&amp;quot;) %&amp;gt;'&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                                                                                                &amp;lt;asp:RequiredFieldValidator ID=&amp;quot;ReqSupportOwnerID1&amp;quot; runat=&amp;quot;server&amp;quot; ControlToValidate=&amp;quot;SupportOwnerID1&amp;quot;
                                                                                                    ErrorMessage=&amp;quot;Please enter the ID of the Application Support owner.&amp;quot; ValidationGroup=&amp;quot;ValGrpEdit&amp;quot;
                                                                                                    Width=&amp;quot;16px&amp;quot;&amp;gt;*&amp;lt;/asp:RequiredFieldValidator&amp;gt;
                                                                                            &amp;lt;/EditItemTemplate&amp;gt;
                                                                                            &amp;lt;ItemStyle Width=&amp;quot;150px&amp;quot; /&amp;gt;
                                                                                        &amp;lt;/asp:TemplateField&amp;gt;
                                                                            
                                                                                   
                                                                                        &amp;lt;asp:TemplateField HeaderText=&amp;quot;Path&amp;quot; SortExpression=&amp;quot;Path&amp;quot;&amp;gt;
                                                                                            &amp;lt;EditItemTemplate&amp;gt;
                                                                                                &amp;lt;asp:TextBox ID=&amp;quot;Path1&amp;quot;  ValidationGroup=&amp;quot;ValGrpEdit&amp;quot; runat=&amp;quot;server&amp;quot; CssClass=&amp;quot;text&amp;quot; Height=&amp;quot;76px&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;Path&amp;quot;) %&amp;gt;'
                                                                                                    TextMode=&amp;quot;MultiLine&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                                                                                                &amp;lt;asp:CustomValidator ID=&amp;quot;txtApplicationPathV&amp;quot; ValidationGroup=&amp;quot;ValGrpEdit&amp;quot; runat=&amp;quot;server&amp;quot;
                                                                                                    ErrorMessage=&amp;quot;Please fill in a path either in URL / Path or URL / Path&amp;quot; ClientValidationFunction=&amp;quot;ValidateEdit&amp;quot;
                                                                                                    ControlToValidate=&amp;quot;Path1&amp;quot; ValidateEmptyText=&amp;quot;true&amp;quot;&amp;gt;*&amp;lt;/asp:CustomValidator&amp;gt;
                                                                                            &amp;lt;/EditItemTemplate&amp;gt;
                                                                                            &amp;lt;ItemTemplate&amp;gt;
                                                                                                &amp;lt;asp:Label ID=&amp;quot;Path2&amp;quot; runat=&amp;quot;server&amp;quot; CssClass=&amp;quot;DisplayDesc&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;Path&amp;quot;) %&amp;gt;'
                                                                                                    Visible=&amp;quot;false&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                                                                                                &amp;lt;asp:LinkButton ID=&amp;quot;lnkpath&amp;quot; runat=&amp;quot;server&amp;quot; CausesValidation=&amp;quot;false&amp;quot; CssClass=&amp;quot;datalink&amp;quot;
                                                                                                    PostBackUrl=&amp;quot;#&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;Path&amp;quot;) %&amp;gt;'&amp;gt;&amp;lt;/asp:LinkButton&amp;gt;
                                                                                                &amp;lt;asp:Panel ID=&amp;quot;Panel3&amp;quot; runat=&amp;quot;server&amp;quot; CssClass=&amp;quot;wrapText&amp;quot;&amp;gt;
                                                                                                    &amp;lt;cc1:HoverMenuExtender ID=&amp;quot;hvrPath&amp;quot;  runat=&amp;quot;server&amp;quot; PopupControlID=&amp;quot;pnlPath&amp;quot; PopupPosition=&amp;quot;Left&amp;quot;
                                                                                                        TargetControlID=&amp;quot;lnkpath&amp;quot;&amp;gt;
                                                                                                    &amp;lt;/cc1:HoverMenuExtender&amp;gt;
                                                                                                    &amp;lt;asp:Panel ID=&amp;quot;pnlPath&amp;quot; runat=&amp;quot;server&amp;quot; CssClass=&amp;quot;balloonstyle&amp;quot; Style=&amp;quot;display: none&amp;quot;
                                                                                                        Width=&amp;quot;200px&amp;quot;&amp;gt;
                                                                                                        &amp;lt;div&amp;gt;
                                                                                                            &amp;lt;table cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;2&amp;quot; width=&amp;quot;200px&amp;quot;&amp;gt;
                                                                                                                &amp;lt;tr&amp;gt;
                                                                                                                    &amp;lt;td class=&amp;quot;LableText&amp;quot;&amp;gt;
                                                                                                                        &amp;lt;%# Eval(&amp;quot;Path&amp;quot;)%&amp;gt;
                                                                                                                    &amp;lt;/td&amp;gt;
                                                                                                                &amp;lt;/tr&amp;gt;
                                                                                                            &amp;lt;/table&amp;gt;
                                                                                                        &amp;lt;/div&amp;gt;
                                                                                                    &amp;lt;/asp:Panel&amp;gt;
                                                                                                &amp;lt;/asp:Panel&amp;gt;
                                                                                            &amp;lt;/ItemTemplate&amp;gt;
                                                                                            &amp;lt;ItemStyle ForeColor=&amp;quot;Black&amp;quot; /&amp;gt;
                                                                                            &amp;lt;ControlStyle /&amp;gt;
                                                                                        &amp;lt;/asp:TemplateField&amp;gt;
                                                                                      
                                                                          
                                                                                        &amp;lt;asp:TemplateField HeaderText=&amp;quot;Category&amp;quot; SortExpression=&amp;quot;Category&amp;quot;&amp;gt;
                                                                                            &amp;lt;EditItemTemplate&amp;gt;
                                                                                                &amp;lt;asp:DropDownList ID=&amp;quot;ddlCategoryList&amp;quot;  ValidationGroup=&amp;quot;ValGrpEdit&amp;quot; runat=&amp;quot;server&amp;quot; AutoPostBack=&amp;quot;True&amp;quot; CssClass=&amp;quot;text&amp;quot;&amp;gt;
                                                                                                &amp;lt;/asp:DropDownList&amp;gt;
                                                                                                &amp;lt;asp:RequiredFieldValidator ID=&amp;quot;RequiredCategory&amp;quot; runat=&amp;quot;server&amp;quot; ControlToValidate=&amp;quot;ddlCategoryList&amp;quot;
                                                                                                    ErrorMessage=&amp;quot;Please select a valid Category.&amp;quot; ValidationGroup=&amp;quot;ValGrpEdit&amp;quot; InitialValue=&amp;quot;-- Select Category --&amp;quot;&amp;gt;*&amp;lt;/asp:RequiredFieldValidator&amp;gt;
                                                                                            &amp;lt;/EditItemTemplate&amp;gt;
                                                                                            &amp;lt;ItemTemplate&amp;gt;
                                                                                                &amp;lt;asp:Label ID=&amp;quot;Category2&amp;quot; runat=&amp;quot;server&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;Category&amp;quot;) %&amp;gt;'&amp;gt;&amp;lt;/asp:Label&amp;gt;
                                                                                            &amp;lt;/ItemTemplate&amp;gt;
                                                                                            &amp;lt;ItemStyle ForeColor=&amp;quot;Black&amp;quot; Width=&amp;quot;10%&amp;quot; /&amp;gt;
                                                                                            &amp;lt;ControlStyle /&amp;gt;
                                                                                        &amp;lt;/asp:TemplateField&amp;gt;
                                                                            
                                                                                    &amp;lt;/Columns&amp;gt;
                                                                                 
                                                                                &amp;lt;/asp:GridView&amp;gt;

my validation summary as

 
 &amp;lt;tr&amp;gt;
                                            &amp;lt;td colspan=&amp;quot;4&amp;quot;&amp;gt; 
                                              &amp;lt;div&amp;gt; &amp;lt;asp:ValidationSummary ID=&amp;quot;ValSumEdit&amp;quot; runat=&amp;quot;server&amp;quot; Font-Bold=&amp;quot;False&amp;quot; Font-Names=&amp;quot;Verdana&amp;quot; ShowMessageBox=&amp;quot;true&amp;quot; DisplayMode=&amp;quot;List&amp;quot; ShowSummary=&amp;quot;false&amp;quot; 
                                                    Font-Size=&amp;quot;10px&amp;quot; HeaderText=&amp;quot;Error Message(s):&amp;quot; ValidationGroup=&amp;quot;ValGrpEdit&amp;quot; Style=&amp;quot;margin-bottom: 23px&amp;quot; EnableClientScript=&amp;quot;true&amp;quot;   /&amp;gt; &amp;lt;/div&amp;gt; 
                                             &amp;lt;/td&amp;gt;
                                            &amp;lt;/tr&amp;gt; 
 
&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/28a3eae5-2c34-4edd-b7d8-81ba21fdb1ec.aspx</link>
      <pubDate>Mon, 20 Aug 2012 18:12:15 GMT</pubDate>
    </item>
    <item>
      <title>Enable Cross domain scripting in web config </title>
      <description>Description: This snippet will enable cross site scripting in your asp.net application. Just put the snippet in the web.config file. If you want to allow specific sites only just replace the star with the web site address.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/a94f8bb5-34a2-4c22-8859-e7508a42266d.aspx'&gt;http://www.codekeep.net/snippets/a94f8bb5-34a2-4c22-8859-e7508a42266d.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt; &amp;lt;system.webServer&amp;gt;
    &amp;lt;modules runAllManagedModulesForAllRequests=&amp;quot;true&amp;quot; /&amp;gt;
        &amp;lt;httpProtocol&amp;gt;
            &amp;lt;customHeaders&amp;gt;
                &amp;lt;add name=&amp;quot;Access-Control-Allow-Origin&amp;quot; value=&amp;quot;*&amp;quot; /&amp;gt;
            &amp;lt;/customHeaders&amp;gt;
        &amp;lt;/httpProtocol&amp;gt;
  &amp;lt;/system.webServer&amp;gt;&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/a94f8bb5-34a2-4c22-8859-e7508a42266d.aspx</link>
      <pubDate>Sun, 15 Jul 2012 07:09:08 GMT</pubDate>
    </item>
    <item>
      <title>MVC Ajax Post ActionLink </title>
      <description>Description: Call an actionresult in Async using Ajax.Action then return a json data, then create a JS method that consumes the Json and display it.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f81b47c0-d6fa-4659-b8e0-15c1fdfe9dc3.aspx'&gt;http://www.codekeep.net/snippets/f81b47c0-d6fa-4659-b8e0-15c1fdfe9dc3.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Razor Part
@Ajax.ActionLink(&amp;quot;View&amp;quot;, -&amp;gt; This is the name that displays on the link
                 &amp;quot;Index&amp;quot;,-&amp;gt; This is the Action Name
                 new { ValId = item.MPID },-&amp;gt; This is the routeArgument/parameter
                 new AjaxOptions { HttpMethod = &amp;quot;POST&amp;quot;, 
                                   OnSuccess = &amp;quot;displayContent&amp;quot; })

-----&amp;gt;this actionlink is use to call the actionresult in the controller

Csharp / Controller Part
public ActionResult Index(string ValId)
    List&amp;lt;object&amp;gt; mpcList = new List&amp;lt;object&amp;gt;();
    //do something like populate the list
return Json(mpcList, JsonRequestBehavior.AllowGet);

-----&amp;gt; After calling the Actionresult it returns a json data, 
       after the whole actionresult is finish, 
       an event is triggered &amp;quot;OnSuccess&amp;quot; to call a method to consume
       the json data and display it.

Javascript Part
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    function displayContent(obj) {
            //obj -&amp;gt; is the returned json format data
            //this example is a table/list structured data
            for (var i = 0; i &amp;lt; obj.length; i++) {
                //do something
            }
        }

        $('#ajaxresult').replaceWith($tbl);
    }
&amp;lt;/script&amp;gt;&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/f81b47c0-d6fa-4659-b8e0-15c1fdfe9dc3.aspx</link>
      <pubDate>Tue, 19 Jun 2012 00:50:37 GMT</pubDate>
    </item>
    <item>
      <title>MVC3 Custom Membership Provider</title>
      <description>Description: Overrides the default ASP.NET membership provider in a MVC3 Web App&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/918207f9-9011-4af8-a59d-486548c07cfe.aspx'&gt;http://www.codekeep.net/snippets/918207f9-9011-4af8-a59d-486548c07cfe.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace CustomProvider.Infrastructure {
    public class CustomMembershipProvider : MembershipProvider {

        private string _applicationName;
        private bool _enablePasswordReset;
        private bool _enablePasswordRetrieval;
        private bool _requiresQuestionAndAnswer;
        private bool _requiresUniqueEmail;
        private int _maxInvalidPasswordAttempts;
        private int _passwordAttemptWindow;
        private int _minRequiredPasswordLength;
        private int _minRequiredNonalphanumericCharacters;
        private string _passwordStrengthRegularExpression;
        private MembershipPasswordFormat _passwordFormat;


        private string GetConfigValue(string configValue, string defaultValue) {
            if ( String.IsNullOrEmpty( configValue ) ) {
                return defaultValue;
            }

            return configValue;
        }


        public override void Initialize( string name, System.Collections.Specialized.NameValueCollection config ) {

            if ( config == null ) {
                throw new ArgumentException( &amp;quot;config&amp;quot; );
            }

            if ( String.IsNullOrEmpty( name ) ) {
                name = &amp;quot;CustomMembershipProvider&amp;quot;;
            }

            if ( String.IsNullOrEmpty( config [ &amp;quot;description&amp;quot; ] ) ) {
                config.Remove( &amp;quot;description&amp;quot; );
                config.Add( &amp;quot;description&amp;quot;, &amp;quot;CustomMembershipProvider&amp;quot; );
            }

            base.Initialize( name, config );

            _applicationName = GetConfigValue( config [ &amp;quot;applicationName&amp;quot; ], System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath );
            _enablePasswordReset = Convert.ToBoolean(GetConfigValue( config [ &amp;quot;enablePasswordReset&amp;quot; ], &amp;quot;true&amp;quot;));
            _enablePasswordRetrieval = false;
            _requiresQuestionAndAnswer = false;
            _requiresUniqueEmail = true;
            _maxInvalidPasswordAttempts = Convert.ToInt32(GetConfigValue( config [ &amp;quot;maxInvalidPasswordAttempts&amp;quot; ], &amp;quot;5&amp;quot;));
            _passwordAttemptWindow = Convert.ToInt32(GetConfigValue( config [ &amp;quot;passwordAttemptWindow&amp;quot; ], &amp;quot;10&amp;quot;));
            _minRequiredPasswordLength = Convert.ToInt32(GetConfigValue( config [ &amp;quot;minRequiredPasswordLength&amp;quot; ], &amp;quot;6&amp;quot;));
            _minRequiredNonalphanumericCharacters = Convert.ToInt32(GetConfigValue( config [ &amp;quot;minRequiredNonalphanumericCharacters&amp;quot; ], &amp;quot;1&amp;quot;));
            _passwordStrengthRegularExpression = GetConfigValue( config [ &amp;quot;passwordStrengthRegularExpression&amp;quot; ], &amp;quot;&amp;quot; );
            _passwordFormat = MembershipPasswordFormat.Hashed;
        }


        public override string ApplicationName {
            get {
                throw new NotImplementedException( );
            }
            set {
                throw new NotImplementedException( );
            }
        }

        public override bool ChangePassword( string username, string oldPassword, string newPassword ) {
            throw new NotImplementedException( );
        }

        public override bool ChangePasswordQuestionAndAnswer( string username, string password, string newPasswordQuestion, string newPasswordAnswer ) {
            throw new NotImplementedException( );
        }

        public override MembershipUser CreateUser( string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status ) {
            throw new NotImplementedException( );
        }

        public override bool DeleteUser( string username, bool deleteAllRelatedData ) {
            throw new NotImplementedException( );
        }

        public override bool EnablePasswordReset {
            get { throw new NotImplementedException( ); }
        }

        public override bool EnablePasswordRetrieval {
            get { throw new NotImplementedException( ); }
        }

        public override MembershipUserCollection FindUsersByEmail( string emailToMatch, int pageIndex, int pageSize, out int totalRecords ) {
            throw new NotImplementedException( );
        }

        public override MembershipUserCollection FindUsersByName( string usernameToMatch, int pageIndex, int pageSize, out int totalRecords ) {
            throw new NotImplementedException( );
        }

        public override MembershipUserCollection GetAllUsers( int pageIndex, int pageSize, out int totalRecords ) {
            throw new NotImplementedException( );
        }

        public override int GetNumberOfUsersOnline( ) {
            throw new NotImplementedException( );
        }

        public override string GetPassword( string username, string answer ) {
            throw new NotImplementedException( );
        }

        public override MembershipUser GetUser( string username, bool userIsOnline ) {
            throw new NotImplementedException( );
        }

        public override MembershipUser GetUser( object providerUserKey, bool userIsOnline ) {
            throw new NotImplementedException( );
        }

        public override string GetUserNameByEmail( string email ) {
            throw new NotImplementedException( );
        }

        public override int MaxInvalidPasswordAttempts {
            get { throw new NotImplementedException( ); }
        }

        public override int MinRequiredNonAlphanumericCharacters {
            get { throw new NotImplementedException( ); }
        }

        public override int MinRequiredPasswordLength {
            get { throw new NotImplementedException( ); }
        }

        public override int PasswordAttemptWindow {
            get { throw new NotImplementedException( ); }
        }

        public override MembershipPasswordFormat PasswordFormat {
            get { throw new NotImplementedException( ); }
        }

        public override string PasswordStrengthRegularExpression {
            get { throw new NotImplementedException( ); }
        }

        public override bool RequiresQuestionAndAnswer {
            get { throw new NotImplementedException( ); }
        }

        public override bool RequiresUniqueEmail {
            get { throw new NotImplementedException( ); }
        }

        public override string ResetPassword( string username, string answer ) {
            throw new NotImplementedException( );
        }

        public override bool UnlockUser( string userName ) {
            throw new NotImplementedException( );
        }

        public override void UpdateUser( MembershipUser user ) {
            throw new NotImplementedException( );
        }

        public override bool ValidateUser( string username, string password ) {
            return true;
        }
    }
}&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/918207f9-9011-4af8-a59d-486548c07cfe.aspx</link>
      <pubDate>Tue, 22 May 2012 07:33:23 GMT</pubDate>
    </item>
    <item>
      <title>Repeater Dropdownlist SelectedIndexChanged Firing</title>
      <description>Description: Repeater Dropdownlist SelectedIndexChanged Firing shows how to execute an action on a dropdownlist postback within a repeater.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/8cf2732a-a605-4100-8bdf-979d7026b6a3.aspx'&gt;http://www.codekeep.net/snippets/8cf2732a-a605-4100-8bdf-979d7026b6a3.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;asp:Repeater ID=&amp;quot;rptrVendors&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
            &amp;lt;ItemTemplate&amp;gt;
                &amp;lt;tr&amp;gt;&amp;lt;td class=&amp;quot;RequiredSubHead&amp;quot; align=&amp;quot;right&amp;quot;&amp;gt;
                    &amp;lt;asp:Label ID=&amp;quot;lblServiceName&amp;quot; runat=&amp;quot;server&amp;quot; Text='&amp;lt;%#Eval(&amp;quot;ServiceName&amp;quot;)%&amp;gt;' /&amp;gt;
                    &amp;lt;asp:Literal ID=&amp;quot;litServiceID&amp;quot; runat=&amp;quot;server&amp;quot; Text='&amp;lt;%#Eval(&amp;quot;ServiceID&amp;quot;)%&amp;gt;' Visible=&amp;quot;false&amp;quot; /&amp;gt;
                &amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 5px&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;
                &amp;lt;td style=&amp;quot;white-space: nowrap&amp;quot; colspan=&amp;quot;2&amp;quot;&amp;gt;
                     &amp;lt;asp:DropDownList ID=&amp;quot;ddlVendorID&amp;quot; runat=&amp;quot;server&amp;quot; Visible=&amp;quot;True&amp;quot; ValidationGroup=&amp;quot;Vendor&amp;quot; Width=&amp;quot;250px&amp;quot; AutoPostBack=&amp;quot;True&amp;quot;&amp;gt;
                    &amp;lt;/asp:DropDownList&amp;gt;
                &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
            &amp;lt;/ItemTemplate&amp;gt;
        &amp;lt;/asp:Repeater&amp;gt;

Protected Sub rptrVendors_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptrVendors.ItemCreated
        If Not e.Item.ItemType = ListItemType.Item And Not e.Item.ItemType = ListItemType.AlternatingItem Then
            Exit Sub
        End If
        Dim litServiceID As Literal = CType(e.Item.FindControl(&amp;quot;litServiceID&amp;quot;), Literal)
        Dim ddlVendorID As DropDownList = CType(e.Item.FindControl(&amp;quot;ddlVendorID&amp;quot;), DropDownList)
        AddHandler ddlVendorID.SelectedIndexChanged, AddressOf ddlVendorID_SelectedIndexChanged
End Sub

Protected Sub ddlVendorID_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim litServiceID As Literal = CType(sender.FindControl(&amp;quot;litServiceID&amp;quot;), Literal)
        ' Code to insert DropDownlist Selected Value into the database via Data Access Layer (DAL).
        Dim objNewOrderDAL As New NewOrderDAL
        objNewOrderDAL.VendorInsert(CInt(Session(&amp;quot;OrderID&amp;quot;)), CInt(litServiceID.Text), CInt(sender.SelectedValue))
End Sub

Protected Sub rptrVendors_ItemDataBound(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptrVendors.ItemDataBound
        If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
            ' Add items to dropdownlist dynamically.
            Dim ddlVendorID As DropDownList = CType(e.Item.FindControl(&amp;quot;ddlVendorID&amp;quot;), DropDownList)
            Dim tListItem As New ListItem
            Dim VendorIDSelected As Integer
            tListItem.Text = &amp;quot;Select Vendor&amp;quot;
            tListItem.Value = &amp;quot;0&amp;quot;
            ddlVendorID.Items.Add(tListItem)
            
        End If
End Sub&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/8cf2732a-a605-4100-8bdf-979d7026b6a3.aspx</link>
      <pubDate>Mon, 27 Feb 2012 13:08:24 GMT</pubDate>
    </item>
    <item>
      <title>Make a button disable on click</title>
      <description>Description: Asp refuses to submit the postback if the button is disabled via javascript. This disables the button immediately after the postback fires&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/1a15f314-87fb-4f6f-88c1-f2e498e13f69.aspx'&gt;http://www.codekeep.net/snippets/1a15f314-87fb-4f6f-88c1-f2e498e13f69.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;OnClientClick=&amp;quot;setTimeout( function() {$('#CopyScenarioButton').attr('disabled', 'disabled');},0)&amp;quot;&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/1a15f314-87fb-4f6f-88c1-f2e498e13f69.aspx</link>
      <pubDate>Mon, 06 Feb 2012 11:43:06 GMT</pubDate>
    </item>
    <item>
      <title>Make asp think css is loaded</title>
      <description>Description: asp.net will complain about css tags it doesn't recognize in user controls that the master page will load. this works around it.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/e2a25f08-40ba-4570-abc8-817ea1426a6c.aspx'&gt;http://www.codekeep.net/snippets/e2a25f08-40ba-4570-abc8-817ea1426a6c.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;% if (false)
{ %&amp;gt; &amp;lt;!-- designer hack allows designer to pick up the common.css that would be picked up when called with a master page anyhow --&amp;gt;
	&amp;lt;link rel=&amp;quot;Stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;~/Styles/Common.css&amp;quot; id=&amp;quot;style&amp;quot; visible=&amp;quot;false&amp;quot; /&amp;gt;
&amp;lt;% }%&amp;gt;&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/e2a25f08-40ba-4570-abc8-817ea1426a6c.aspx</link>
      <pubDate>Mon, 06 Feb 2012 10:39:39 GMT</pubDate>
    </item>
    <item>
      <title>Web SiteMap Remove Menu Node</title>
      <description>Description: VB NET shows how to remove a menu node from the site map for a given page. &lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/d1c53fee-c6f1-47db-b196-22eda5890e8c.aspx'&gt;http://www.codekeep.net/snippets/d1c53fee-c6f1-47db-b196-22eda5890e8c.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;THis assumes you have a WEB.SITEMAP file and a Menu1 using the sitemap as the datasource.

CODE BEHIND OF CALLING PAGE

Protected Sub Menu1_MenuItemDataBound(ByVal sender As Object, ByVal e As MenuEventArgs) Handles Menu1.MenuItemDataBound
        If e.Item.Text = &amp;quot;Your Menu Node Title&amp;quot; Then
            If CBool(Session(&amp;quot;MyPermissions&amp;quot;)) = False Then
                e.Item.Parent.ChildItems.Remove(e.Item)
            End If
        End If
End Sub&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/d1c53fee-c6f1-47db-b196-22eda5890e8c.aspx</link>
      <pubDate>Thu, 26 Jan 2012 15:30:01 GMT</pubDate>
    </item>
    <item>
      <title>MvcHtmlString - EmbedTemplate</title>
      <description>Description: generic wrapper for ActionLink that allows you to use it with any function that expects a string, and returns an mvchtmlstring&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/90f90f62-440e-4f4b-bbac-60075845dcd9.aspx'&gt;http://www.codekeep.net/snippets/90f90f62-440e-4f4b-bbac-60075845dcd9.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;private static HelperResult EmbedTemplate(Func&amp;lt;string, MvcHtmlString&amp;gt; helperFunc, Func&amp;lt;object, HelperResult&amp;gt; template)
		{
			var firstPass = helperFunc(&amp;quot;[replaceme]&amp;quot;);
			var asString = firstPass.ToString();
			var replaced = asString.Replace(&amp;quot;[replaceme]&amp;quot;, template(null).ToString());
			return new HelperResult(writer =&amp;gt;
			{
				writer.Write(replaced);
			});
		}&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/90f90f62-440e-4f4b-bbac-60075845dcd9.aspx</link>
      <pubDate>Wed, 04 Jan 2012 12:05:27 GMT</pubDate>
    </item>
    <item>
      <title>ActionLinkEmbedHtml</title>
      <description>Description: Regular ActionLink overloads do not allow you to embed raw html inside them, this gets around that. Not sure if it will work with embedding any javascript however.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/78b86aab-da63-468d-beaf-9fcef622f458.aspx'&gt;http://www.codekeep.net/snippets/78b86aab-da63-468d-beaf-9fcef622f458.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;namespace System.Web.Mvc
{
 public static class HtmlHelpers
    {
		/// &amp;lt;summary&amp;gt;
		/// Used when the regular actionLinks do not allow custom html inside
		/// &amp;lt;/summary&amp;gt;
		/// &amp;lt;param name=&amp;quot;helper&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
		/// &amp;lt;param name=&amp;quot;result&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
		/// &amp;lt;param name=&amp;quot;template&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
		/// &amp;lt;param name=&amp;quot;options&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
		/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
		public static HelperResult ActionLink(this AjaxHelper helper,ActionResult result, Func&amp;lt;object,HelperResult&amp;gt; template,AjaxOptions options)
		{
		    var link=helper.ActionLink(&amp;quot;[replaceme]&amp;quot;,result,options);
			var asString=link.ToString();
			var replaced=asString.Replace(&amp;quot;[replaceme]&amp;quot;,template(null).ToString());

			return new HelperResult(writer =&amp;gt;
			{
				writer.Write(replaced);
			});
		}
}
}&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/78b86aab-da63-468d-beaf-9fcef622f458.aspx</link>
      <pubDate>Wed, 04 Jan 2012 12:01:56 GMT</pubDate>
    </item>
    <item>
      <title>Validate Zip</title>
      <description>Description: This is a regular expression that will validate a zip code&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/23d9f5e1-f99f-45d8-9289-663c1993a47f.aspx'&gt;http://www.codekeep.net/snippets/23d9f5e1-f99f-45d8-9289-663c1993a47f.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;^\d{5}([\-]\d{4})?$&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/23d9f5e1-f99f-45d8-9289-663c1993a47f.aspx</link>
      <pubDate>Wed, 14 Dec 2011 12:48:13 GMT</pubDate>
    </item>
    <item>
      <title>Validate Date</title>
      <description>Description: This is a regular expression that can be used to validate a date&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/ab1b7174-1b17-4720-9717-5d9d919121e8.aspx'&gt;http://www.codekeep.net/snippets/ab1b7174-1b17-4720-9717-5d9d919121e8.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/ab1b7174-1b17-4720-9717-5d9d919121e8.aspx</link>
      <pubDate>Wed, 14 Dec 2011 09:29:25 GMT</pubDate>
    </item>
    <item>
      <title>Repeater Code Behind</title>
      <description>Description: Repeater Code Behind shows ItemCommand and ItemDataBound in ASP.NET VB&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/5b90aa0c-e914-47fa-8b0c-b4f81fa8d613.aspx'&gt;http://www.codekeep.net/snippets/5b90aa0c-e914-47fa-8b0c-b4f81fa8d613.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;!-- CODE IN FRONT ---&amp;gt;
&amp;lt;asp:Repeater ID=&amp;quot;rptMyRepeater&amp;quot; runat=&amp;quot;server&amp;quot; OnItemCommand=&amp;quot;rptMyRepeater_ItemCommand&amp;quot;&amp;gt;
                    &amp;lt;ItemTemplate&amp;gt;
                        &amp;lt;tr&amp;gt;
                        &amp;lt;td class=&amp;quot;tabtablerow&amp;quot;&amp;gt;
                            &amp;lt;asp:HiddenField ID=&amp;quot;hdID&amp;quot; value='&amp;lt;%# Eval(&amp;quot;ID&amp;quot;)%&amp;gt;' runat=&amp;quot;server&amp;quot; /&amp;gt;
                            &amp;lt;/td&amp;gt;
                        &amp;lt;td class=&amp;quot;tabtablerow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;
                            &amp;lt;asp:ImageButton ID=&amp;quot;ibtnEdit&amp;quot; runat=&amp;quot;server&amp;quot; CommandName=&amp;quot;EditThis&amp;quot; CssClass=&amp;quot;caseInput&amp;quot; CausesValidation=&amp;quot;False&amp;quot; ImageUrl=&amp;quot;~/images/icon-edit.png&amp;quot; AlternateText=&amp;quot;Edit&amp;quot; Width=&amp;quot;18&amp;quot; Height=&amp;quot;18&amp;quot; /&amp;gt;
                            &amp;lt;asp:ImageButton ID=&amp;quot;ibtnSave&amp;quot; runat=&amp;quot;server&amp;quot; CommandName=&amp;quot;SaveThis&amp;quot; CssClass=&amp;quot;caseInput&amp;quot; CausesValidation=&amp;quot;False&amp;quot; ImageUrl=&amp;quot;~/images/icon-save.png&amp;quot; AlternateText=&amp;quot;Edit&amp;quot; Width=&amp;quot;18&amp;quot; Height=&amp;quot;18&amp;quot; Visible=&amp;quot;false&amp;quot; /&amp;gt;
                            &amp;lt;/td&amp;gt;
                       &amp;lt;td class=&amp;quot;tabtablerow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;
                            &amp;lt;asp:ImageButton ID=&amp;quot;ibtnIsActive&amp;quot; runat=&amp;quot;server&amp;quot; CommandName=&amp;quot;IsActiveThis&amp;quot; CssClass=&amp;quot;caseInput&amp;quot; CausesValidation=&amp;quot;False&amp;quot; ImageUrl=&amp;quot;~/images/icon-checked.png&amp;quot; AlternateText=&amp;quot;Is Active&amp;quot; Width=&amp;quot;18&amp;quot; Height=&amp;quot;18&amp;quot; /&amp;gt;
                            &amp;lt;/td&amp;gt;
                        &amp;lt;td class=&amp;quot;tabtablerow&amp;quot;&amp;gt;
                            &amp;lt;asp:ImageButton ID=&amp;quot;ibtnDelete&amp;quot; runat=&amp;quot;server&amp;quot; CommandName=&amp;quot;DeleteThis&amp;quot; CssClass=&amp;quot;caseInput&amp;quot; CausesValidation=&amp;quot;False&amp;quot; ImageUrl=&amp;quot;~/images/btn_delete.png&amp;quot; AlternateText=&amp;quot;Delete&amp;quot; Width=&amp;quot;49&amp;quot; Height=&amp;quot;18&amp;quot; OnClientClick=&amp;quot;return confirm('DELETE This?');&amp;quot; /&amp;gt;
                            &amp;lt;/td&amp;gt;
                        &amp;lt;/tr&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;/asp:Repeater&amp;gt;

&amp;lt;!-- CODE BEHIND --&amp;gt;
#Region &amp;quot;Binding&amp;quot;
    Private Sub BindData(ByVal LastName As String, ByVal FirstName As String)
        Dim objUserManagerDAL As New UserManagerDAL
        Dim ds As DataSet
        ds = objUserManagerDAL.UsersSearch(LastName, FirstName)
        rptMyRepeater.DataSource = ds
        rptMyRepeater.DataBind()
    End Sub
#End Region

#Region &amp;quot;Repeater Actions&amp;quot;
    Protected Sub rptMyRepeater_ItemDataBound(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptMyRepeater.ItemDataBound
        ' Exit function if this is not in ItemTemplate   
        If Not e.Item.ItemType = ListItemType.AlternatingItem AndAlso Not e.Item.ItemType = ListItemType.Item Then Exit Sub

        Dim item As RepeaterItem
        item = e.Item
        Dim hdID As HiddenField = CType(item.FindControl(&amp;quot;hdID&amp;quot;), HiddenField)
        Dim ibtnDelete As ImageButton = CType(item.FindControl(&amp;quot;ibtnDelete&amp;quot;), ImageButton)


        If CInt(hdID.Value) = 0 Then
            ibtnDelete.Visbile = False
        End If              
    End Sub

    Protected Sub rptMyRepeater_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles rptMyRepeater.ItemCommand
        ' Exit function if this is not in ItemTemplate   
        If Not e.Item.ItemType = ListItemType.AlternatingItem AndAlso Not e.Item.ItemType = ListItemType.Item Then Exit Sub

        Dim item As RepeaterItem
        item = e.Item
        Dim hdID As HiddenField = CType(item.FindControl(&amp;quot;hdID&amp;quot;), HiddenField)
        Dim ibtnEdit As ImageButton = CType(item.FindControl(&amp;quot;ibtnEdit&amp;quot;), ImageButton)
        Dim ibtnSave As ImageButton = CType(item.FindControl(&amp;quot;ibtnSave&amp;quot;), ImageButton)
        Dim ibtnIsActive As ImageButton = CType(item.FindControl(&amp;quot;ibtnIsActive&amp;quot;), ImageButton)
        Dim ibtnDelete As ImageButton = CType(item.FindControl(&amp;quot;ibtnDelete&amp;quot;), ImageButton)        If e.CommandName = &amp;quot;DeleteThis&amp;quot; Then
            
        If e.CommandName = &amp;quot;DeleteThis&amp;quot; Then

        ElseIf e.CommandName = &amp;quot;EditThis&amp;quot; Then
            
        ElseIf e.CommandName = &amp;quot;SaveThis&amp;quot; Then
            
        ElseIf e.CommandName = &amp;quot;IsActiveThis&amp;quot; Then
            
        End If
    End Sub
#End Region&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/5b90aa0c-e914-47fa-8b0c-b4f81fa8d613.aspx</link>
      <pubDate>Wed, 23 Nov 2011 12:02:40 GMT</pubDate>
    </item>
    <item>
      <title>Set locale id in Cookie</title>
      <description>Description: Set locale id in Cookie&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/decabe35-598d-4a87-8fe4-39b66190a8a9.aspx'&gt;http://www.codekeep.net/snippets/decabe35-598d-4a87-8fe4-39b66190a8a9.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Set locale id in Cookie&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/decabe35-598d-4a87-8fe4-39b66190a8a9.aspx</link>
      <pubDate>Tue, 11 Oct 2011 23:59:14 GMT</pubDate>
    </item>
    <item>
      <title>Date Compare (VB)</title>
      <description>Description: Date Compare Function for ASP.NET VB&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/c4b6796c-c771-4982-b154-20d70c144ff7.aspx'&gt;http://www.codekeep.net/snippets/c4b6796c-c771-4982-b154-20d70c144ff7.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Imports System.mscorlib 

Dim date1 As Date = #08/01/2009 12:00AM#
Dim date2 As Date = #08/01/2009 12:00PM#
Dim result As Integer = DateTime.Compare(date1, date2)
Dim relationship As String

If result &amp;lt; 0 Then
   relationship = &amp;quot;is earlier than&amp;quot;
ElseIf result = 0 Then
   relationship = &amp;quot;is the same time as&amp;quot;         
Else
   relationship = &amp;quot;is later than&amp;quot;
End If
&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/c4b6796c-c771-4982-b154-20d70c144ff7.aspx</link>
      <pubDate>Tue, 04 Oct 2011 14:48:37 GMT</pubDate>
    </item>
    <item>
      <title>Load Page Path into Javascript variable</title>
      <description>Description: Loading a page path from the server/server code into a javascript variable for consumption elsewhere&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/719c5738-0026-49af-b1ce-c6f884b4f75e.aspx'&gt;http://www.codekeep.net/snippets/719c5738-0026-49af-b1ce-c6f884b4f75e.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;
var pagePath='&amp;lt;%=VirtualPathUtility.ToAbsolute(&amp;quot;~/PageName&amp;quot;) %&amp;gt;';
&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/719c5738-0026-49af-b1ce-c6f884b4f75e.aspx</link>
      <pubDate>Fri, 23 Sep 2011 16:39:05 GMT</pubDate>
    </item>
    <item>
      <title>Data Caching Dropdown (VB)</title>
      <description>Description: Function to cache a dataset and use in dropdown list. ASP.NET VB&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/ed16d5db-593a-4f61-b907-91e20dc66a6f.aspx'&gt;http://www.codekeep.net/snippets/ed16d5db-593a-4f61-b907-91e20dc66a6f.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;   Private Function LoadDataSet(ByVal Sql As String) As DataSet
        Try
            Dim objConnGODB As New connGODB
            Dim ds As New DataSet
            ds = objConnGODB.getDataSet(Sql)
            Return ds
        Catch ex As Exception
            Throw New Exception(&amp;quot;There was a problem with DropDowns.LoadDataSet. &amp;quot; &amp;amp; ex.Message)
        End Try
    End Function

    Public Function GetCachedData(ByVal DropDownListName As String, ByVal Sql As String) As DataSet
        ' This gets data from the cache, or reinserts it if older than 12 hours.
        Dim ds As DataSet
        If IsNothing(HttpContext.Current.Cache(DropDownListName)) Then
            HttpContext.Current.Cache.Insert(DropDownListName, LoadDataSet(Sql), Nothing, DateTime.Now.AddHours(12.0), TimeSpan.Zero)
        End If
        ds = HttpContext.Current.Cache(DropDownListName)
        Return ds
    End Function

    Public Sub AdjusterRoles(ByVal DDL As DropDownList)
        Dim ds As DataSet
        ds = GetCachedData(&amp;quot;AdjusterRoles&amp;quot;, &amp;quot;SELECT RoleName, RoleID FROM dbo.Roles (NOLOCK) WHERE RoleID BETWEEN 7 AND 11 ORDER BY RoleName&amp;quot;)
        PopulateDropDownDS(DDL, ds, &amp;quot;RoleName&amp;quot;, &amp;quot;RoleID&amp;quot;)
    End Sub

    Public Sub PopulateDropDownDS(ByVal DDL As DropDownList, ByVal ds As DataSet, ByVal txt As String, ByVal val As String)
        DDL.Items.Clear()
        If ds.Tables(0).Rows.Count &amp;gt; 0 Then
            For mRow As Integer = 0 To ds.Tables(0).Rows.Count - 1
                DDL.Items.Add(New ListItem(ds.Tables(0).Rows.Item(mRow).Item(txt).ToString, ds.Tables(0).Rows.Item(mRow).Item(val).ToString))
            Next
        End If
    End Sub&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/ed16d5db-593a-4f61-b907-91e20dc66a6f.aspx</link>
      <pubDate>Thu, 15 Sep 2011 15:44:10 GMT</pubDate>
    </item>
    <item>
      <title>Hash Salt (VB)</title>
      <description>Description: Calculates Hash of specified password + Salt from DB  ASP.NET VB&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/d4d03e7f-baaf-494c-bd25-11f4bccb94de.aspx'&gt;http://www.codekeep.net/snippets/d4d03e7f-baaf-494c-bd25-11f4bccb94de.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;' Calculate Hash of specified password + Salt from DB
  Set CM = Server.CreateObject(&amp;quot;Persits.CryptoManager&amp;quot;)
  Set Context = CM.OpenContext(&amp;quot;mycontainer&amp;quot;, True)
  Set Hash = Context.CreateHash
  Hash.AddText Request(&amp;quot;Password&amp;quot;) &amp;amp; Salt
  HashValue2 = Hash.Value.Hex
  Set Hash = Nothing
  Set CM = Nothing&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/d4d03e7f-baaf-494c-bd25-11f4bccb94de.aspx</link>
      <pubDate>Thu, 15 Sep 2011 10:10:22 GMT</pubDate>
    </item>
    <item>
      <title>LOOP through FORM (VB)</title>
      <description>Description: This loops through all form fields and shows how to count the number of FALSE values. ASP.NET VB&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/8f644284-9670-4ae0-b1e9-731d234ff070.aspx'&gt;http://www.codekeep.net/snippets/8f644284-9670-4ae0-b1e9-731d234ff070.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Dim iCount = 0
Dim TotalNoAnswers = 0
lblTest.Text = &amp;quot;OK:&amp;quot;
  For Each Item In Request.Form
    If Request.Form(Request.Form.Keys(iCount).ToString) = &amp;quot;False&amp;quot; Then
      TotalNoAnswers += 1
    End If
    iCount += 1
  Next&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/8f644284-9670-4ae0-b1e9-731d234ff070.aspx</link>
      <pubDate>Thu, 15 Sep 2011 10:08:38 GMT</pubDate>
    </item>
    <item>
      <title>Valida Campo data com Ano bisexto</title>
      <description>Description: Baixar plugin maskedinput.js para mascara do Jquery&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/dbb2927b-5ca1-4ed0-85d4-14644b3934a1.aspx'&gt;http://www.codekeep.net/snippets/dbb2927b-5ca1-4ed0-85d4-14644b3934a1.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;script src=&amp;quot;../Scripts/maskedinput/maskedinput.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;asp:TextBox  ID=&amp;quot;txtPessDtNascimento&amp;quot;   CssClass=&amp;quot;txtPessDtNascimento&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;80px&amp;quot; MaxLength=&amp;quot;10&amp;quot; /&amp;gt; dd/mm/aaaa

 &amp;lt;asp:RegularExpressionValidator ID=&amp;quot;RegularExpressionValidator2&amp;quot; SetFocusOnError=&amp;quot;true&amp;quot;
                        runat=&amp;quot;server&amp;quot; ControlToValidate=&amp;quot;txtPessDtNascimento&amp;quot; ErrorMessage=&amp;quot;Data Inv&amp;#225;lida&amp;quot;
                        ValidationGroup=&amp;quot;Basicos&amp;quot; EnableClientScript=&amp;quot;true&amp;quot; ValidationExpression=&amp;quot;^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$&amp;quot; /&amp;gt;


&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;

    jQuery(function ($) {

        try {
            $(&amp;quot;.txtPessDtNascimento&amp;quot;).mask(&amp;quot;99/99/9999&amp;quot;);
        } catch (e) {
            alert(e);
        }

    });
&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/dbb2927b-5ca1-4ed0-85d4-14644b3934a1.aspx</link>
      <pubDate>Tue, 13 Sep 2011 23:21:20 GMT</pubDate>
    </item>
    <item>
      <title>MySql .net provider</title>
      <description>Description: A note for myself, making public in case its of use to anyone else.  Its off the jitbit forum faq&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/c3af19af-54a8-499e-9f08-1c73724e4778.aspx'&gt;http://www.codekeep.net/snippets/c3af19af-54a8-499e-9f08-1c73724e4778.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Install the &amp;quot;MySQL Connector .Net&amp;quot;. If you use Godaddy (or another hosting provider) - place the &amp;quot;MySQL.Data.dll&amp;quot; to the &amp;quot;bin&amp;quot; folder and add this to your web.config:

&amp;lt;system.data&amp;gt;
  &amp;lt;DbProviderFactories&amp;gt;
    &amp;lt;add name=&amp;quot;MySQL Data Provider&amp;quot; invariant=&amp;quot;MySql.Data.MySqlClient&amp;quot; description=&amp;quot;.Net Framework Data Provider for MySQL&amp;quot; type=&amp;quot;MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=5, Culture=neutral&amp;quot; /&amp;gt;
  &amp;lt;/DbProviderFactories&amp;gt;
&amp;lt;/system.data&amp;gt;&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/c3af19af-54a8-499e-9f08-1c73724e4778.aspx</link>
      <pubDate>Fri, 09 Sep 2011 06:21:40 GMT</pubDate>
    </item>
    <item>
      <title>Finding ASP.NET Gridview internal button</title>
      <description>Description: This is how you will search a button object within the parent GridView

How:if you put your button inside of gridview and you want to read it&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/a860697a-89d7-46d4-b531-858a243529db.aspx'&gt;http://www.codekeep.net/snippets/a860697a-89d7-46d4-b531-858a243529db.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;protected void Button1_Click(object sender, EventArgs e)
{
        Button btn = (Button)sender;
        GridViewRow row = (GridViewRow)btn.NamingContainer;
        Response.Write(&amp;quot;Row Index of Link button: &amp;quot; + row.RowIndex +
                       &amp;quot;DataKey value:&amp;quot; + GridView1.DataKeys[row.RowIndex].Value.ToString());
}&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/a860697a-89d7-46d4-b531-858a243529db.aspx</link>
      <pubDate>Sat, 27 Aug 2011 06:51:44 GMT</pubDate>
    </item>
    <item>
      <title>Standard DataGrid</title>
      <description>Description: Standard Data Grid&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/7c66f9f9-0c39-4759-9d40-443bb594b36b.aspx'&gt;http://www.codekeep.net/snippets/7c66f9f9-0c39-4759-9d40-443bb594b36b.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;%@ Register Assembly=&amp;quot;NEA.WebControls&amp;quot; Namespace=&amp;quot;NEA.WebControls&amp;quot; TagPrefix=&amp;quot;nea&amp;quot; %&amp;gt;

&amp;lt;div class=&amp;quot;tableHeader&amp;quot;&amp;gt;
    &amp;lt;div style=&amp;quot;padding: 2px; border-bottom: solid 1px black;&amp;quot;&amp;gt;
        &amp;lt;%-- ADD ANY HEADER CONTROLS HERE --%&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;tableFooter&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;pager&amp;quot;&amp;gt;
        &amp;lt;asp:DataPager ID=&amp;quot;pager&amp;quot; runat=&amp;quot;server&amp;quot; PageSize=&amp;quot;15&amp;quot; PagedControlID=&amp;quot;uxMainGrid&amp;quot;&amp;gt;
            &amp;lt;Fields&amp;gt;
                &amp;lt;asp:NextPreviousPagerField ButtonCssClass=&amp;quot;command&amp;quot; FirstPageText=&amp;quot;&amp;#171;&amp;quot; PreviousPageText=&amp;quot;<&amp;quot; RenderDisabledButtonsAsLabels=&amp;quot;true&amp;quot;
                    ShowFirstPageButton=&amp;quot;true&amp;quot; ShowPreviousPageButton=&amp;quot;true&amp;quot; ShowLastPageButton=&amp;quot;false&amp;quot; ShowNextPageButton=&amp;quot;false&amp;quot; /&amp;gt;
                &amp;lt;asp:NumericPagerField ButtonCount=&amp;quot;15&amp;quot; NumericButtonCssClass=&amp;quot;command&amp;quot; CurrentPageLabelCssClass=&amp;quot;current&amp;quot; NextPreviousButtonCssClass=&amp;quot;command&amp;quot;
                    NextPageText=&amp;quot;more...&amp;quot; /&amp;gt;
                &amp;lt;asp:NextPreviousPagerField ButtonCssClass=&amp;quot;command&amp;quot; LastPageText=&amp;quot;&amp;#187;&amp;quot; NextPageText=&amp;quot;>&amp;quot; RenderDisabledButtonsAsLabels=&amp;quot;true&amp;quot;
                    ShowFirstPageButton=&amp;quot;false&amp;quot; ShowPreviousPageButton=&amp;quot;false&amp;quot; ShowLastPageButton=&amp;quot;true&amp;quot; ShowNextPageButton=&amp;quot;true&amp;quot; /&amp;gt;
            &amp;lt;/Fields&amp;gt;
        &amp;lt;/asp:DataPager&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div style=&amp;quot;width: 100%; text-align: center; padding: 2px;&amp;quot;&amp;gt;
        &amp;lt;%-- ADD ANY FOOTER CONTROLS HERE --%&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;%-- DON'T FORGET THE DATA KEYS --%&amp;gt;
&amp;lt;div id=&amp;quot;div-datagrid&amp;quot; class=&amp;quot;tableContent&amp;quot; style=&amp;quot;top: 50px;&amp;quot;&amp;gt;
    &amp;lt;nea:DataPagerGridView ID=&amp;quot;uxMainGrid&amp;quot; runat=&amp;quot;server&amp;quot; AutoGenerateColumns=&amp;quot;False&amp;quot; Width=&amp;quot;100%&amp;quot; EmptyDataText=&amp;quot;No records to display&amp;quot;
        HeaderStyle-Height=&amp;quot;30px&amp;quot; BackColor=&amp;quot;LightGoldenrodYellow&amp;quot; CellPadding=&amp;quot;2&amp;quot; CellSpacing=&amp;quot;0&amp;quot; CaptionAlign=&amp;quot;Bottom&amp;quot;
        DataKeyNames=&amp;quot;&amp;quot; AllowPaging=&amp;quot;True&amp;quot; HeaderStyle-Font-Size=&amp;quot;9pt&amp;quot;&amp;gt;
    &amp;lt;/nea:DataPagerGridView&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;</description>
      <link>http://www.codekeep.net/snippets/7c66f9f9-0c39-4759-9d40-443bb594b36b.aspx</link>
      <pubDate>Wed, 20 Jul 2011 11:24:04 GMT</pubDate>
    </item>
  </channel>
</rss>