GridView Update command and checking values

How do I make sure the right values are entered when updating from the GridView? Is there a way to error check?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

hfponConnect With a Mentor Commented:
Convert your boundfields into templatefields;
then put validation control to the textboxes and set those validation control display as dynamic.
For example;

            <asp:TemplateField HeaderText="Effect" SortExpression="sEffect" >
                    <asp:TextBox ID="TextBox2" runat="server" Height="50px" Text='<%# Bind("sEffect") %>'
                        TextMode="MultiLine" Width="150px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox2"
                        Display="Dynamic" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("sEffect") %>' Width="150px"></asp:Label>
HangTenDesignAuthor Commented:
Hi, this is very good but not giving me the desired result. Is there any way to wire a client side javascript function. I manager to put a OnClientClick on the EditTemplate UpdateCommand button but I don't know how to predict the DOM reference of the renderend text box inside the GridView.

Maybe there is another way to do Client side error check and alert box.
All Courses

From novice to tech pro — start learning today.