Solved

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

Posted on 2008-10-26
6
334 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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.…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now