Passing value to javascript function "onload" event from datagrid
Hi all,
Very much confuse with this.
I have a datagrid, and i am able to pass the value to javascript function through "onclick" event as below:
e.item.attributes.add("onclick","javascript:myfunction('"+value1+"');");
but, when i am trying to pass the value of the first row on datagrid through "onload" event as below:
dg.Items[0].Attributes.Add("onload","javascript:myfunction('"+value1+"');");
it's not passing the value.
I have to use onload event, so i can display default value th' javascript function.
Any help will be appreciated.
Thanks,
NIKI
DhruvilPosted Jun 30, 2006, 8:26 AM
Anwar BuchooPosted Jun 30, 2006, 3:31 AM
Someting like:
Button MyBtn = dg.FindControl("btnOk");
MyBtn.Attribtutes.Add("function goes here");
and this within the datagrid's OnDataBound event.