User Conformation On datagrid update command

S

Santosh

Dear all i want to call javascript function for asking user to conform
about specific action

i am writting following code but when i am click on update & cancel
same function is called
so please tell me solution behind them.
i want to call java script function on only update button


public void SetUpClientValidation(object sender, DataGridItemEventArgs
e)
{
if(e.Item.ItemType == ListItemType.Edit)
{
e.Item.Cells[3].Attributes.Add("OnClick","JavaScript:return
ConformUpdateInformation();");

}

function ConformUpdateInformation()
{
return confirm("Are you sure to Update records?");
}


Help will be apreciated
 
J

John Prado

Try

e.Item.Cells[3].Controls(0).Attributes.Add(...

You are putting your "onclick" event on table cell not in your LinkButton.
 

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,996
Messages
2,570,237
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top