?
Solved

GridView Update command and checking values

Posted on 2006-11-02
2
Medium Priority
?
256 Views
Last Modified: 2008-01-09
How do I make sure the right values are entered when updating from the GridView? Is there a way to error check?
0
Comment
Question by:HangTenDesign
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
hfpon earned 750 total points
ID: 17864577
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" >
                <EditItemTemplate>
                    <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>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("sEffect") %>' Width="150px"></asp:Label>
                </ItemTemplate>
0
 

Author Comment

by:HangTenDesign
ID: 17867881
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.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question