PDA

Click to See Complete Forum and Search --> : Client to Server function call...


vbud
Feb 14th, 2003, 04:54 AM
hi

could somebody please tell me if it is possible to call a function defined in a codebehind vb file from client side script..? Alternatively, I have a datagrid to which I am adding 2 ButtonColumns at run time. I need to implement the click event of these ButtonColumns. Actually I am using the Datagrid's onItemCommand to fire a Sub that will then determine, according to the button's CommandName what procedure to call. Only that my procedures are on server side(i.e in the codebehind vb file) and I can't find a way to call them.

Any help would be much appreciated

thanx.

fungi
Feb 14th, 2003, 09:57 AM
Perhaps I'm missing something but you should be able to create an event handler for each of your button columns and not need to go to the trouble you are describing.



Private Sub DataGrid1_UpdateCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.UpdateCommand

...Update Stuff...

End Sub

Private Sub DataGrid1_CancelCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.CancelCommand
Datagrid1.EditItemIndex = -1
BindGrid()
End Sub