473,385 Members | 1,693 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 21 '05 #1
4 2319

"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 21 '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 21 '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 21 '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 21 '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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.