Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 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

15 Experts available now in Live!

Get 1:1 Help Now