I can not pass parameters from view to controller in MVC using URL

0

I'm doing an MVC project and am not able to pass the Search window parameter to the Controller that is reaching View . I'm going to go through both classes, if you need more information I see editing here:

OfficeListing.cshtml

@model Affonso_DW.Models.ListaGabineteModels

@{
    Layout = null;
    int cont = 0;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script><title></title></head><body><div><labelfor="Gabinete">
            <b>Gabinetes</b><br />
        </label>

        <div id="accordion">
            <div class="card">

                @foreach (var gabinete in Model.ListaGabinete)
                {
                    <div class="card-header">
                        <!-- comandos data-toggle controlam o layout do menu a ser usado-->
                        <a class="card-link" data-toggle="collapse" href="#collapse-@cont">
                            @gabinete.GabineteDW.Name
                        </a>
                    </div>

                    <div id="collapse-@cont" class="collapse" data-parent="#accordion">
                        <b>Janelas de Pesquisa</b><br />
                        @foreach (var janelaPesquisa in gabinete.ListaJanelaPesquisa)
                        {
                            <div class="card-body">
                                <a href="@Url.Action("JanelaPesquisaIndex", "JanelaPesquisa", new { janelaPesquisa = janelaPesquisa })">
                                    @janelaPesquisa.JanelaPesquisaDW.DisplayName
                                </a>
                            </div>
                        }
                    </div>
                    cont++;
                }
            </div>
        </div>
    </div>
</body>
</html>

SearchWindowController.cs

public class JanelaPesquisaController : Controller
    {
        JanelaPesquisa janelaPesquisa = new JanelaPesquisa();

        // GET: JanelaPesquisa
        [HttpGet]
        public ActionResult JanelaPesquisaIndex(JanelaPesquisa janelaPesquisa)
        {
            JanelaPesquisaModels janelaPesquisaModels = new JanelaPesquisaModels(janelaPesquisa);

            return View(janelaPesquisaModels);
        }
    }
    
asked by anonymous 31.10.2018 / 03:19

0 answers