0
我在我的頁面中的地圖和點擊標記時,它關係到是這樣的一個RptVendedorController動作金球獎,URL標記使用ASP.NET MVC4
public ActionResult Balloon(int id,string tipoPin , bool clienteCompleto)
爲?/ RptVendedor /氣球/ 4 tipoPin = clientes:我創建這樣
Url.Action("Balloon", "RptVendedor", new { id = cliente.ClienteId, tipoPin = "clientes", clienteCompleto = true }) }
,讓這在服務器側
URL標記的URLclienteCompleto =真
我的問題是,由於某種原因,URL變化,當我點擊該標記,這是我得到的網址(如下)將其添加(AMP;),所以它不打我的行動,因爲它不能很好地格式化客戶端查詢字符串
Request URL:http://localhost:10657/RptVendedor/Balloon/4?tipoPin=clientes&clienteCompleto=True
並且不知道它爲什麼添加(amp;
編輯
我投入一個ViewModel
Globo = new MostrarMapaGlobo { Ancho = 400, Alto = 200, Url = Url.Action("Balloon", "RptVendedor", new { id = cliente.ClienteId, tipoPin = "clienteGeografico" }) }
,並在局部視圖
@foreach (var pin in Model.Pines)
{
<text>
var marker = new google.maps.Marker({
position: new google.maps.LatLng(@pin.Posicion.Latitud, @pin.Posicion.Longitud),
map: map,
title: '@pin.AltText',
icon: new google.maps.MarkerImage('@Html.Raw(pin.Icono.Replace("[color]", pin.Color.Substring(1)))'),
@if (pin.Click)
{
@:clickable: true,
}
else
{
@:clickable: false,
}
@if(pin.Movil)
{
@:draggable: true,
}
else
{
@:draggable: false,
}
@if (!string.IsNullOrWhiteSpace(pin.Globo.Extras))
{
@[email protected]:,
}
ancho: '@pin.Globo.Ancho' + 'px',
alto: '@pin.Globo.Alto' + 'px',
url: '@pin.Globo.Url',
contenido: '@pin.Globo.Contenido'
});
oms.addMarker(marker);
markers.push(marker);
</text>
if (Model.Ruta != null && pin.Ruta)
{
@:posiciones.push(new google.maps.LatLng(@pin.Posicion.Latitud, @pin.Posicion.Longitud));
}
}
在哪裏你使用Url.Actio N(...)'?在超鏈接或在一些腳本? – 2013-04-25 12:59:45
我編輯的問題,我創建一個viewmodel然後在viewmodel我把url – 2013-04-25 13:07:43