Action type A is modified by clicking Action type B

Asked

Viewed 40 times

0

Follows code:

_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 line <li>@Html.ActionLink("Início", "Index", "Home")</li>(Type A) loses. It modifies the line to Tipo/Pagina?Length=9.

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

UPDATE:

I’ve tried that way and the problem continues:

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

Follows Photo:

inserir a descrição da imagem aqui

1 answer

0


I found the problem.

Change that:

<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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.