Hi..
I am trying to use javascript for google maps display.
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. I need to pass an argument to the function
call.Am I passing the value wrongly??
I am calling it this way:
Response.Write("<script
language='javascript'>showAddress(getAddress);</script>");
where, getAddress is the comma-seperated Address string.
This is not displaying the map, I am creating using Javascript.
Thx 5 9704
Yes, you are passing the literal string "getAddress". I think what you want
is to pass an actual value of a string variable that represents your comma -
delimited address string, e.g.:
string getAddress = "1 Park Ave, New York, NY, 10023";
Response.Write("<script
language='javascript'>showAddress(" +getAddress+ ");</script>");
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"moni" wrote:
Hi..
I am trying to use javascript for google maps display.
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. I need to pass an argument to the function
call.Am I passing the value wrongly??
I am calling it this way:
Response.Write("<script
language='javascript'>showAddress(getAddress);</script>");
where, getAddress is the comma-seperated Address string.
This is not displaying the map, I am creating using Javascript.
Thx
On Apr 11, 3:38 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
Yes, you are passing the literal string "getAddress". I think what you want
is to pass an actual value of a string variable that represents your comma -
delimited address string, e.g.:
string getAddress = "1 Park Ave, New York, NY, 10023";
Response.Write("<script
language='javascript'>showAddress(" +getAddress+ ");</script>");
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"moni" wrote:
Hi..
I am trying to use javascript for google maps display.
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. I need to pass an argument to the function
call.Am I passing the value wrongly??
I am calling it this way:
Response.Write("<script
language='javascript'>showAddress(getAddress);</script>");
where, getAddress is the comma-seperated Address string.
This is not displaying the map, I am creating using Javascript.
Thx- Hide quoted text -
- Show quoted text -
Thanx for the reply....but when i use this, it runs w/o displaying the
map, and gives,
Done,with errors on the page
Error: Expected ')'
But my javascript function works otherwise, and the Response.Write
line also calls it exactly this way
Response.Write("<script language='javascript'>showAddress("
+getAddress+ ");</script>");
Can you tell me wat the possible error could be.
Try putting single quotes around the parameter value, to the left and to the
right of the double quotes. Look at the string that is emitted and see if it
is legal javascript.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"moni" wrote:
On Apr 11, 3:38 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
Yes, you are passing the literal string "getAddress". I think what you want
is to pass an actual value of a string variable that represents your comma -
delimited address string, e.g.:
string getAddress = "1 Park Ave, New York, NY, 10023";
Response.Write("<script
language='javascript'>showAddress(" +getAddress+ ");</script>");
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"moni" wrote:
Hi..
I am trying to use javascript for google maps display.
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. I need to pass an argument to the function
call.Am I passing the value wrongly??
I am calling it this way:
Response.Write("<script
language='javascript'>showAddress(getAddress);</script>");
where, getAddress is the comma-seperated Address string.
This is not displaying the map, I am creating using Javascript.
Thx- Hide quoted text -
- Show quoted text -
Thanx for the reply....but when i use this, it runs w/o displaying the
map, and gives,
Done,with errors on the page
Error: Expected ')'
But my javascript function works otherwise, and the Response.Write
line also calls it exactly this way
Response.Write("<script language='javascript'>showAddress("
+getAddress+ ");</script>");
Can you tell me wat the possible error could be.
On Apr 11, 4:10 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
Try putting single quotes around the parameter value, to the left and to the
right of the double quotes. Look at the string that is emitted and see if it
is legal javascript.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"moni" wrote:
On Apr 11, 3:38 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
Yes, you are passing the literal string "getAddress". I think what you want
is to pass an actual value of a string variable that represents your comma -
delimited address string, e.g.:
string getAddress = "1 Park Ave, New York, NY, 10023";
Response.Write("<script
language='javascript'>showAddress(" +getAddress+ ");</script>");
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"moni" wrote:
Hi..
I am trying to use javascript for google maps display.
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. I need to pass an argument to the function
call.Am I passing the value wrongly??
I am calling it this way:
Response.Write("<script
language='javascript'>showAddress(getAddress);</script>");
where, getAddress is the comma-seperated Address string.
This is not displaying the map, I am creating using Javascript.
Thx- Hide quoted text -
- Show quoted text -
Thanx for the reply....but when i use this, it runs w/o displaying the
map, and gives,
Done,with errors on the page
Error: Expected ')'
But my javascript function works otherwise, and the Response.Write
line also calls it exactly this way
Response.Write("<script language='javascript'>showAddress("
+getAddress+ ");</script>");
Can you tell me wat the possible error could be.- Hide quoted text -
- Show quoted text -
I tried doing that, it still doesnt show. Can you tell me any other
way, or the AJAx way to go about it.
On Apr 11, 4:25 pm, "moni" <mons.2...@gmail.comwrote:
On Apr 11, 4:10 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
Try putting single quotes around the parameter value, to the left and to the
right of the double quotes. Look at the string that is emitted and see if it
is legal javascript.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"moni" wrote:
On Apr 11, 3:38 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
Yes, you are passing the literal string "getAddress". I think what you want
is to pass an actual value of a string variable that represents your comma -
delimited address string, e.g.:
string getAddress = "1 Park Ave, New York, NY, 10023";
Response.Write("<script
language='javascript'>showAddress(" +getAddress+ ");</script>");
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"moni" wrote:
Hi..
I am trying to use javascript for google maps display.
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. I need to pass an argument to the function
call.Am I passing the value wrongly??
I am calling it this way:
Response.Write("<script
language='javascript'>showAddress(getAddress);</script>");
where, getAddress is the comma-seperated Address string.
This is not displaying the map, I am creating using Javascript.
Thx- Hide quoted text -
- Show quoted text -
Thanx for the reply....but when i use this, it runs w/o displaying the
map, and gives,
Done,with errors on the page
Error: Expected ')'
But my javascript function works otherwise, and the Response.Write
line also calls it exactly this way
Response.Write("<script language='javascript'>showAddress("
+getAddress+ ");</script>");
Can you tell me wat the possible error could be.- Hide quoted text -
- Show quoted text -
I tried doing that, it still doesnt show. Can you tell me any other
way, or the AJAx way to go about it.- Hide quoted text -
- Show quoted text -
Can I use something like:
string myMap = ("<script language='javascript'>showAddress("+getAddress
+ ");</script>");
Page.RegisterClientScriptBlock(" don know",myMap);
But this is not working too...Plz help... This discussion thread is closed Replies have been disabled for this discussion. Similar topics
reply
views
Thread by Prescott |
last post: by
|
1 post
views
Thread by hrishikesh |
last post: by
|
1 post
views
Thread by alf |
last post: by
|
2 posts
views
Thread by hibaru |
last post: by
|
10 posts
views
Thread by Janus |
last post: by
|
4 posts
views
Thread by verci |
last post: by
| | | | | | | | | | | | | | |