473,809 Members | 2,891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a javascript function from aspx.cs file

Hi,

I wanted to call a javascript function

function showAddress(add ress)
{
.....
}

from the aspx.cs file from the Gridview_RowCom mand function

protected void GridView1_RowCo mmand(object sender,
GridViewCommand EventArgs 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 7673
you can just use:

Response.Write( "<script language='javas cript'>showAddr ess();</script>");

or use ajax which is more complex

--
sharepoint developper
"moni" wrote:
Hi,

I wanted to call a javascript function

function showAddress(add ress)
{
.....
}

from the aspx.cs file from the Gridview_RowCom mand function

protected void GridView1_RowCo mmand(object sender,
GridViewCommand EventArgs 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...@dis cussions.micros oft.comwrote:
you can just use:

Response.Write( "<script language='javas cript'>showAddr ess();</script>");

or use ajax which is more complex

--
sharepoint developper

"moni" wrote:
Hi,
I wanted to call a javascript function
function showAddress(add ress)
{
.....
}
from the aspx.cs file from the Gridview_RowCom mand function
protected void GridView1_RowCo mmand(object sender,
GridViewCommand EventArgs 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='javas cript'>showAddr ess(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="Huntingt on Avenue,
Boston, MA" name="yourName" style="width: 287px" />
<input type="button" id="addressclic k" value="Display Map"
onclick="showAd dress(addresste xt.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
2431
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 javascript function in the .aspx file and used the following to call the javascript function from the popup window
0
2389
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 button called "cmdFilter" which retrieves data from the database using any criteria thus selected. For any of the records retrieved into the grid match certain conditions, one of the columns will be formed into a hyperlink. Clicking on this will...
0
1847
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 button called "cmdFilter" which retrieves data from the database using any criteria thus selected. For any of the records retrieved into the grid match certain conditions, one of the columns will be formed into a hyperlink. Clicking on this will...
14
25644
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, ASP.NET, ASP.NET Mobile) Windows Mobile 2003 (Pocket IE) I have completed a portion of the conversion (ASP.NET Mobile pages for PIE, and some of the ASP.NET-bases web services), and while testing I have a runtime error that did not exist in the...
2
2253
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 and should show an alert. How can i acheive it. If I call the aspx file directly it works as
1
1674
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 src="javascripts/popcalendar.js" type="text/javascript"/> <script language="javascript" type="text/javascript"> function callpopup(v1,v2,v3,v4) { var txtName =document.getElementById(v1).value; var txtSal = document.getElementById(v2).value; ...
3
2734
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
2750
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 javascript that works fine until I try to separate the script into a .js file. I've found that only the script that is called from events set in the aspx.cs file don't work. I eliminated all script except two functions. One is used with the .cs file...
9
2223
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"); alert(document.getElementById("<%=LBFacilities.ClientID%>").options.length); return false; } </script>
0
10633
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10375
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3860
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.