473,385 Members | 1,766 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.

Calling a javascript function from .aspx.cs file

Hi,

I wanted to call a javascript function

function showAddress(address)
{
.....
}

from the aspx.cs file from the Gridview_RowCommand function

protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
......
//got a string value a
//showAddress(a);
}

How would i be able to call the function from here.

Any help will be appreciated.

Thanks alot...

Apr 11 '07 #1
3 2719
The Gridview_RowCommand function runs on server. Javascript function runs in
client's browser. That is in different time and in different place. You
likely may not need a trip to the server in the first place. What are you
trying to achieve?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"moni" <mo*******@gmail.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.com...
Hi,

I wanted to call a javascript function

function showAddress(address)
{
....
}

from the aspx.cs file from the Gridview_RowCommand function

protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
.....
//got a string value a
//showAddress(a);
}

How would i be able to call the function from here.

Any help will be appreciated.

Thanks alot...

Apr 11 '07 #2
On Apr 11, 5:12 am, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
The Gridview_RowCommand function runs on server. Javascript function runs in
client's browser. That is in different time and in different place. You
likely may not need a trip to the server in the first place. What are you
trying to achieve?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldin

"moni" <mons.2...@gmail.comwrote in message

news:11**********************@b75g2000hsg.googlegr oups.com...
Hi,
I wanted to call a javascript function
function showAddress(address)
{
....
}
from the aspx.cs file from the Gridview_RowCommand function
protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
.....
//got a string value a
//showAddress(a);
}
How would i be able to call the function from here.
Any help will be appreciated.
Thanks alot...- Hide quoted text -

- Show quoted text -
Hi..

I am actually getting the value, the user selects from the gridview so
that I get the address from the SQL server, and then i am using google
maps javascript, to display the map.

Thx..

Apr 11 '07 #3
You should communicate your intention to show the map and the address from
server to client. You can do in hidden input fields. This article can help
you:

How to Pass Messages and Actions between Server and Client
http://usableasp.net/DeveloperPage.a...rAndClient.htm

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"moni" <mo*******@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
On Apr 11, 5:12 am, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
>The Gridview_RowCommand function runs on server. Javascript function runs
in
client's browser. That is in different time and in different place. You
likely may not need a trip to the server in the first place. What are you
trying to achieve?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldin

"moni" <mons.2...@gmail.comwrote in message

news:11**********************@b75g2000hsg.googleg roups.com...
Hi,
I wanted to call a javascript function
function showAddress(address)
{
....
}
from the aspx.cs file from the Gridview_RowCommand function
protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
.....
//got a string value a
//showAddress(a);
}
How would i be able to call the function from here.
Any help will be appreciated.
Thanks alot...- Hide quoted text -

- Show quoted text -

Hi..

I am actually getting the value, the user selects from the gridview so
that I get the address from the SQL server, and then i am using google
maps javascript, to display the map.

Thx..

Apr 11 '07 #4

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

Similar topics

2
by: Michelle Stone | last post by:
I have an asp.net form, which calls a popup window. The popup window, based on some user input should call a function on the parent window. Is this possible? I have tried creating a...
0
by: teddysnips | last post by:
I have Search form that allows users to retrieve records into a DataGrid. There are two search criteria - a Month and a Year, which are selected from drop-down lists. There is a server-side...
0
by: teddysnips | last post by:
I have Search form that allows users to retrieve records into a DataGrid. There are two search criteria - a Month and a Year, which are selected from drop-down lists. There is a server-side...
14
by: Rich | last post by:
I am converting my enterprise solution from VS 2003 (.NET v1.1.4322) to VS 2005 (.NET v2.0.50727). The entire solution uses serveral technologies - Windows Server 2003 (AD, SQL Server 2000, IIS,...
2
by: Ravi | last post by:
Hi, I am trying to call an aspx page from an htm file. I have written something like this in my htm file <script src="Test.aspx"></script? The Test.aspx page should call a javascript function...
1
by: susmitha | last post by:
hai iam a fresher in .net.My problem is I have one javascript sourcefile and some javascript functions in my aspx page like shown below. <script language=javascript...
2
by: moni | last post by:
Hi, I wanted to call a javascript function function showAddress(address) { ..... } from the aspx.cs file from the Gridview_RowCommand function
2
by: Matthew Wells | last post by:
Hello. I'm reposting this because my prioe post's subject line was incorrect. I'm developing an asp.net 2.0 project using VS 2005 on XP sp2 with all the updates. I have an aspx page with...
9
by: Matthew Wells | last post by:
OK, I've narrowed down the problem. This works when in the aspx page <script type="text/javascript" > function btnFirst_Click() { alert("Hello");...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.