Action of type A is modified by clicking Action type B

0

Follow the code below:

_Layout:

<div class="navbar-collapse collapse">
     <li>@Html.ActionLink("Início", "Index", "Home", new { @onmouseover = "this.style.color='#5cb85c';", @onmouseout = "this.style.color='';" })</li>
     <li>@Html.ActionLink("Sobre", "About", "Home")</li>
     <li>@Html.ActionLink("Contato", "Contact", "Home")</li>
</div>

View:

@using (Html.BeginForm("Upload", "Upload", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)


    <a id="voltar_pagina">Outra página</a>
}

JS:

$("#voltar_pagina").click(function () {
    window.location = '/Pagina/Tipo'
});

Problem:

When I click Outra página (Type B), the <li>@Html.ActionLink("Início", "Index", "Home")</li> (Type A) line loses. It modifies the line to Tipo/Pagina?Length=9 .

Any solution? Because I'm not seeing the problem.

UPDATE:

I've tried this way and the problem continues:

<button type="button" onclick="location.href='@Url.Action("Tipo", "Pagina")'" >Outra página</button>

Photo:

    
asked by anonymous 17.05.2017 / 21:35

1 answer

0

I discovered the problem.

Change this:

<li>@Html.ActionLink("Início", "Index", "Home", new { @onmouseover = "this.style.color='#5cb85c';", @onmouseout = "this.style.color='';" })</li>

To:

<li>@Html.ActionLink("Início", "Index", "Home")</li>
    
18.05.2017 / 01:11