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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
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 Mon, 13 Jan 2014 13:09:31 +0000 (UTC)
Organization A noiseless patient Spider
Lines 32
Message-ID <lb0oib$k2a$2@dont-email.me> (permalink)
References <lb0ldf$83j$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Mon, 13 Jan 2014 13:09:31 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="66ffcfa4470a58bcddbdcd1913f98ab4"; logging-data="20554"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19P0jwvWRORwcrGZAhylgCegmcfvWSuXIs="
User-Agent Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2)
Cancel-Lock sha1:TK48HODyxi3LtCGzkJM/TFieijU=
Xref csiph.com comp.lang.javascript:22600

Show key headers only | 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