Call function

  • Thread starter Thread starter ruca
  • Start date Start date
R

ruca

Hi,

Can anyone tell me how can I call a function of my Web Page from
javascritp????

I have a grid that when I click in a cell I want to call another function
present in that same page?
It is possible to do that?
 
ruca said:
Hi,

Can anyone tell me how can I call a function of my Web Page from
javascritp????

I have a grid that when I click in a cell I want to call another function
present in that same page?
It is possible to do that?


--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

In the grids ItemDataBound event handler, you can get a reference to the
specific cell (e.Item.Cells collection). Then use the cell's Attributes
collection to add a javascript string...quick non-tested example:

Private Sub grdMyGrid_ItemDataBound( _
ByVal sender As Object, _
ByVal e As DataGridEventArgs _
) Handles grdMyGrid.ItemDataBound
' Check the type of item is...i think using ItemType property...
' can't remember.
e.Item.Cells(0).Attributes.Add( _
"onclick", _
"javascript:MyClientSideFunction();" _
)
End Sub

HTH,
Mythran
 
Mythran,

I know that..... But the problem is that I don´t want to call a client side
function. I want to call another functio present in vb file of my aspx page.

Hope you understand. But thanks anyway
 
ruca said:
Mythran,

I know that..... But the problem is that I don´t want to call a client
side function. I want to call another functio present in vb file of my
aspx page.

Hope you understand. But thanks anyway

So, on the client's machine, you want to call a function that resides on the
server? This can only be done with a post back (for simplicity, otherwise
there are ways to do it and examples on the Internet).

Mythran
 
Back
Top