?
Solved

validating inputs in itemdatabound method  while updating a row in a datagrid

Posted on 2008-10-26
6
Medium Priority
?
363 Views
Last Modified: 2012-06-21
Hi!
I have the following code in my aspx page
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="&lt;img src=../images/ok.gif border=0 alt=Update&gt;"CancelText="&lt;img src=../images/cancel.gif border=0 alt=Reset&gt;" EditText="&lt;img src=../images/edit.gif border=0 alt=Edit&gt;">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:EditCommandColumn>
I want to validate the fields while updating a row using javascript from the item databound method.
How do I do  a findcontrol on update button....it's an image.
Please let me know ASAP.
I'll be really greatful, if i can get the logic and teh code to do that.

IT'D EXTREMELY URGENT.I NEED IT ASAP.

THANKS A LOT IN ADVANCE
0
Comment
Question by:amukta
[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
6 Comments
 
LVL 8

Expert Comment

by:mkosbie
ID: 22808056
I'm not sure I understand the question.  The ItemDataBound event fires while a record is being DISPLAYED from the DB, not updated.  Also, javascript is a client side language, you can't use it for the server side ItemDataBound event.

In general, if you want to validate your inputs, you should use ASP.NETs built in validation controls: http://www.w3schools.com/aspnet/aspnet_refvalidationcontrols.asp
0
 

Author Comment

by:amukta
ID: 22808095
I'm not supposed to use the validation controls. yes. I know itemdatabound fires when the row displays.
But I need to validate the controls using javascript. I'm able to do it for add
the add button is a link button. But I'm unable to do a find control for update button as it's an image as u can see in the above code.

Can u plz. help me know how do to a find control for update
I can handle the rest.
The update button has a text as image inside the edit command column.
how can I do a find control....since, there's no id.

I need it ASAP.
IT'S EXTREMELY URGENT.

0
 
LVL 13

Accepted Solution

by:
sm394 earned 2000 total points
ID: 22808350
i cant help you exactly but this may help
http://aspnet.4guysfromrolla.com/articles/090902-1.2.aspx
check section When the "Edit" Button is Clicked.....
0
 
LVL 13

Expert Comment

by:sm394
ID: 22808368
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

771 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