0

Im trying after save a session redirect my webpage to another path of my asp.net project the code is down here:

(function (marker, data) {
    google.maps.event.addListener(marker, "click", function (e) {
        infoWindow.setContent('<div class="card" style ="width:200px;height:auto;">' +
        '<img class="card-img-top" src='+data.photo+' style="width:200px;height:auto;" >' +
        '<div class="card-body">'+
        '<h5 class="card-title">' + data.title + '</h5>' +
        '<p class="card-text">' + data.description + '</p>' +
        '<button id="btn_seedetails" >Click me</button>' +
        '</div>' + 
        '</div >' );
        infoWindow.open(map, marker);
        google.maps.event.addDomListener(document.getElementById('btn_seedetails'), 'click', sendit);                                           
   });

   function sendit() {
       '<%Session["ID_EVENT"] = "' + data.id + '"; %>';
       document.location.href = "AllConflicts.aspx";
       location.replace("AllConflicts.aspx")
   }
})(marker, data);
JP Hellemons
  • 5,977
  • 11
  • 63
  • 128
André
  • 97
  • 1
  • 1
  • 9

1 Answers1

0

Perhaps use the querystring to pass data:

function sendit() {
    window.location.href("AllConflicts.aspx?id=" + data.id);
}

also a nice ref for redirecting in JS How do I redirect to another webpage?

Perhaps data.id is not available in the function. You might want to use an input parameter for the sendit function.

JP Hellemons
  • 5,977
  • 11
  • 63
  • 128