Tuesday 15 April 2014

c# - Adding Model data supplied by a SOAP feed to a URL string -



c# - Adding Model data supplied by a SOAP feed to a URL string -

so i've got bit of puzzle on 1 , unless i'm looking wrong thing on google i'm not drawing many answers.

so i'm trying add together google maps function website pre-completes search query post code of property.

i've got piece of model info contains postcode property , how results populated info too.

however want place @ end of google maps query having user click on image so. code looks currently.

javascript:

<script> var postcodeurl = {@model.postcode }; function addurl(element) { $(element).attr('href', function () { homecoming this.href + (postcodeurl()); }); } </script>

my code in view looks this:

<a onclick="addurl(this)" href="http://maps.google.co.uk?en&p="> <img src="@url.content("~/content/images/maps-bg.png")" alt="maps-bg" /></a> <div class="mask"></div> <p class="small"> @model.address1<br />@model.address2<br />@model.postcode </p>

i read somewhere need serialize info in order post url. not quite sure how accomplish this.. or if that's correct.

any help great. thanks

if need pass querystring , means get request, don't have go serialization , hence append ..&p= required value.

c# jquery asp.net-mvc

No comments:

Post a Comment