validation of edit row and insert row in GridView
<p>Simple question? I have a gridview with an insert row in the footer and i have validation controls for that row and the edittemplate how do get it to only validate for that row because when i do an edit it validates the insert row aswell. I just wnat to validate the insert row or edit row.</p>

<pre><code>    &lt;asp:GridView ID="PageSettings" runat="server"
    AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False"
    AutoGenerateDeleteButton="True"
    AutoGenerateEditButton="True"   
    DataKeyNames="Id"
    DataSourceID="ObjectDataSourcePages"
    OnLoad="PageSettings_Load"         
    OnRowDataBound="PageSettings_DataBound"
    OnRowCommand="PageSettings_RowCommand"
    OnRowCreated="PageSettings_RowCreated"
    OnRowEditing="PageSettings_RowEditing" 
    OnRowCancelingEdit="PageSettings_RowCancelingEdit" 
    OnRowUpdating="PageSettings_RowUpdating"      
    OnPageIndexChanging="PageSettings_PageIndexChanging"
    OnSorting="PageSettings_Sorting" 
    OnSorted="PageSetting_Sorted"    
    PageSize="2"
    ShowFooter="True"
    ShowHeaderWhenEmpty="True"&gt;
    &lt;Columns&gt;
        &lt;asp:TemplateField HeaderText="Page Name" HeaderStyle-HorizontalAlign="Left" SortExpression="Name"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("Name") %&gt;
            &lt;/ItemTemplate&gt;
            &lt;EditItemTemplate&gt;
                &lt;asp:TextBox ID="Name" runat="server" Text='&lt;%# Bind("Name") %&gt;'&gt;&lt;/asp:TextBox&gt;
                &lt;asp:RequiredFieldValidator ID="valRequireName" runat="server"
                    ControlToValidate="Name"
                    CssClass="gridview-error"     
                    Display="Dynamic"
                    SetFocusOnError="true"&gt;*&lt;/asp:RequiredFieldValidator&gt;    
            &lt;/EditItemTemplate&gt; 
            &lt;FooterTemplate&gt;
                &lt;asp:TextBox ID="InsertName" runat="server"&gt;&lt;/asp:TextBox&gt;
                &lt;asp:RequiredFieldValidator ID="valRequireInsertName" runat="server"
                    ControlToValidate="InsertName"
                    Display="Dynamic"
                    SetFocusOnError="true"&gt;*&lt;/asp:RequiredFieldValidator&gt;
            &lt;/FooterTemplate&gt;               
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Path" HeaderStyle-HorizontalAlign="Left" SortExpression="Path"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("Path") %&gt;
            &lt;/ItemTemplate&gt;
            &lt;EditItemTemplate&gt;                    
                &lt;asp:TextBox ID="Path" runat="server" Text='&lt;%# Bind("Path") %&gt;'&gt;&lt;/asp:TextBox&gt;
                &lt;asp:RequiredFieldValidator ID="valRequirePath" runat="server"
                    ControlToValidate="Path"
                    Display="Dynamic"
                    SetFocusOnError="true"&gt;*&lt;/asp:RequiredFieldValidator&gt;    
            &lt;/EditItemTemplate&gt;
            &lt;FooterTemplate&gt;
                &lt;asp:TextBox ID="InsertPath" runat="server"&gt;&lt;/asp:TextBox&gt;
                &lt;asp:RequiredFieldValidator ID="valRequireInsertPath" runat="server"
                    ControlToValidate="InsertPath"
                    Display="Dynamic"
                    SetFocusOnError="true"&gt;*&lt;/asp:RequiredFieldValidator&gt;   
            &lt;/FooterTemplate&gt;               
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Route Value" HeaderStyle-HorizontalAlign="Left" SortExpression="RouteValue"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("RouteValue") %&gt;
            &lt;/ItemTemplate&gt;
            &lt;EditItemTemplate&gt;
                &lt;asp:TextBox ID="RouteValue" runat="server" Text='&lt;%# Bind("RouteValue") %&gt;'&gt;&lt;/asp:TextBox&gt;
            &lt;/EditItemTemplate&gt;
            &lt;FooterTemplate&gt;
                &lt;asp:TextBox ID="InsertRouteValue" runat="server"&gt;&lt;/asp:TextBox&gt;
            &lt;/FooterTemplate&gt;               
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="RegExp" HeaderStyle-HorizontalAlign="Left" SortExpression="RegExp"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("RegExp") %&gt;
            &lt;/ItemTemplate&gt;
            &lt;EditItemTemplate&gt;
                &lt;asp:TextBox ID="RegExp" runat="server" Text='&lt;%# Bind("RegExp") %&gt;'&gt;&lt;/asp:TextBox&gt;
            &lt;/EditItemTemplate&gt;
            &lt;FooterTemplate&gt;
                &lt;asp:TextBox ID="InsertRegExp" runat="server"&gt;&lt;/asp:TextBox&gt;
            &lt;/FooterTemplate&gt;               
        &lt;/asp:TemplateField&gt;
    &lt;/Columns&gt;                
&lt;/asp:GridView&gt;
</code></pre>
