Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

98
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda