Solved

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

Posted on 2008-10-26
6
347 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…

733 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