473,396 Members | 2,034 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,396 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
2 7640
you can just use:

Response.Write("<script language='javascript'>showAddress();</script>");

or use ajax which is more complex

--
sharepoint developper
"moni" wrote:
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, 2:18 am, time is life
<timeisl...@discussions.microsoft.comwrote:
you can just use:

Response.Write("<script language='javascript'>showAddress();</script>");

or use ajax which is more complex

--
sharepoint developper

"moni" wrote:
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..

This is not displaying the map, I am creating using Javascript.

I am calling it this way:

Response.Write("<script
language='javascript'>showAddress(getAddress);</script>");

where, getAddress is the comma-seperated Address string.

I am trying to use google maps.

If I call the javascript function from my aspx file I use:

<input type="text" id="addresstext" value="Huntington Avenue,
Boston, MA" name="yourName" style="width: 287px" />
<input type="button" id="addressclick" value="Display Map"
onclick="showAddress(addresstext.value)" /><br />

and it works. But using the Response.Write from the aspx.cs file it
does not display it. Am I passing the value wrongly??

Thx

Apr 11 '07 #3

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...
3
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: 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...
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...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.