Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

95
Vistas
Dynamically select layer from list of layers

I have leafletmap with group of Stations in asp.net project. I want when i click on the station from the list some processes to start. That part is working fine, but after that i have a postback. Is there a way to remember the clicked station(can be id or number) and then to click it again dynamically?

Actually all i want is that selected layer from the list to be selected again after the postback.

The code for starting these Processes in c#:

     mymap.on('baselayerchange', function (eventLayer) {
            var selectedLayer = eventLayer.layer;
            var id = selectedLayer._leaflet_id;
            id = id - 1;
            var el = selectedLayer._layers[id]._popup._content;
            var slug = el.split('ID=').pop();
            var hdnfldVariable = document.getElementById('MainContent_hdnfldVariable');
            hdnfldVariable.value = slug;
            document.getElementById("MainContent_Btn").click();;
          
        });

I add the id of the current station in HiddenField which is used after that and then press that Button which start all the processes in the c# code. Everything else is working fine , just when all of these processes are done, there is postback and after that from the list "Show all" is selected.

Example of the map

Thanks :)

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda