calling javascript in update text(Edit Command Column)

P

pepsi

hi,
how can we call javascript function in update command.i am using...

<asp:editcommandcolumn HeaderText="Modify" EditText="Edit"
CancelText="Cancel" UpdateText="Save" ButtonType="LinkButton"
runat="server"></asp:editcommandcolumn>

how ever if i click edit,javascript function is calling but i want to call
only when the update is clicked


here is the sample code i have used to call the javascript when EDIT is
clicked ....

Sub dgd_userlogsession_ItemBound(Sender As Object, e As DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem then
'e.Item.Cells(2).Text= e.Item.DataSetIndex + 1
Dim txtTest as TextBox
dim btn as LinkButton
Dim a ,b
txtTest = e.Item.FindControl("txtdgddate")
'btn = e.Item.Cells(9).Controls(0)
'btn = e.Item.FindControl(0)
if(e.Item.Cells(9).HasControls()) Then
btn = CType(e.Item.Cells(9).Controls(0), LinkButton)
If btn.CommandName = "dgd_userlogsession_updatecmd" Then
response.Write("hi sucess")
btn.Attributes.Add("onclick", "return funValidate();")
End If
End IF
End if
End Sub


how can call when update is clicked ? how can i differntitate for edit ?

Thanks in advance.
regards
pepsi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top