Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22600

Re: How to I write if I want to use the passed caseID instead of the static number 999

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: How to I write if I want to use the passed caseID instead of the static number 999
Date 2014-01-13 13:09 +0000
Organization A noiseless patient Spider
Message-ID <lb0oib$k2a$2@dont-email.me> (permalink)
References <lb0ldf$83j$1@dont-email.me>

Show all headers | View raw


On Mon, 13 Jan 2014 13:15:18 +0100, Tony Johansson wrote:

> When I use the static literal 999 it works but I must use the passed
> parameter caseID instead when I create a query string
> 
>  function CallServerForUpdate(caseID)
>        {
>          xmlRequest.open("GET",
> "<%=Page.ResolveUrl("~/GoogleMapCallbackHandler.ashx?caseID=" + 999)%>",
> true);
>            xmlRequest.onreadystatechange = ApplyUpdate;
>            xmlRequest.send(null);
>        }

I suspect that you're mixing up server side and client side code here.

I don't know what uses <%= .... %> for server side code, but I suspect 
you may want something more like:

xmlRequest.open( 
"GET", 
"<%= Page.ResolveUrl("~/GoogleMapCallbackHandler.ashx" %>" + "?caseID=" + 
caseID, 
true);

You can't resolve your client side parameter to the function inside the 
server side code section, because that client side parameter doesn't 
exist when the server side processing generates the page to send to the 
client.

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to I write if I want to use the passed caseID instead of the static number 999 "Tony Johansson" <johansson.andersson@telia.com> - 2014-01-13 13:15 +0100
  Re: How to I write if I want to use the passed caseID instead of the static number 999 Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-13 13:09 +0000
    Re: How to I write if I want to use the passed caseID instead of the static number 999 Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-01-13 18:19 -0200
  Re: How to I write if I want to use the passed caseID instead of the static number 999 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-13 14:10 +0100

csiph-web