473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Call function

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
Nov 19 '05 #1
4 1839

"ruca" <ru***@iol.pt> wrote in message
news:eT**************@tk2msftngp13.phx.gbl...
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

Nov 19 '05 #2
Ruca,

You can add any function in the normal way as you do in javascript in HTML,
as long as that you can reach by instance the click event.

If it is a normal button than you can do it in the VB.net code as well.

See this sample.

http://www.windowsformsdatagridhelp....0-82d66e99fa11

I hope this helps,

Cor
Nov 19 '05 #3
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

--
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

"Mythran" <ki********@hotmail.comREMOVETRAIL> escreveu na mensagem
news:%2****************@tk2msftngp13.phx.gbl...

"ruca" <ru***@iol.pt> wrote in message
news:eT**************@tk2msftngp13.phx.gbl...
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

Nov 19 '05 #4

"ruca" <ru***@iol.pt> wrote in message
news:Ou**************@TK2MSFTNGP11.phx.gbl...
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

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: mangi03 | last post by:
Hi, I came acrosss g++ compile errors whenever I make a function call by reference and found out from the test program that compiler is treating the function argument differently when another...
3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
4
by: Dave | last post by:
I have a program that I've written a class for. I need to call the function in the program from the class. When I try to call the function I receive the error, the name xxx does not exist in the...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
5
by: Kurt Van Campenhout | last post by:
Hi, I am trying to get/set Terminal server information in the active directory on a windows 2000 domain. Since the ADSI calls for TS don't work until W2K3, I need to do it myself. I'm fairly...
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
46
by: Steven T. Hatton | last post by:
I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it says. http://java.sun.com/docs/books/tutorial/essential/concurrency/syncrgb.html <shrug> -- NOUN:1. Money or...
0
by: Mike S | last post by:
I've seen examples of using the CallWindowProc Windows API function to call functions through their addresses in VB6 -- a clever workaround to emulate C-like function pointer semantics. A...
9
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this...
6
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.