How to send a special character to the view, asp.net mvc?

1

I have a situation where I would like to position the page in the same position as the container where it was before sending Get?

Example:

<!-- ==== contato ==== -->
<div class="container" id="contato" name="contato">
    <div class="row">

            @Html.Partial("_PartialMensagens")
            @using (Html.BeginForm("CadastroContato", "Representante", FormMethod.Get))
            {
            <form>
                <div class="form-group">
                    <input type="text" class="form-control" id="ContatoNome" name="ContatoNome" required placeholder="Nome"><br />
                    <input type="text" class="form-control" id="Telefone" name="Telefone" required placeholder="Celular"><br />
                    <input type="text" class="form-control" id="ContatoCidade" name="ContatoCidade" required placeholder="Cidade  UF"><br>
                    <textarea rows="4" cols="30" name="Mensagem" id="Mensagem"  class="form-control" required placeholder="Mensagem..."></textarea>
                    <br>
                    <button type="submit" class="btn btn-success">Enviar</button>
                </div>
            </form>
            }
    </div><!-- row -->

</div><!-- container -->
<!-- ==== contato ==== -->

I would need to return this path: link

This example does not work because it does not recognize the

return RedirectToAction("index", "Representante", new { id = Session["IdPaginaUsuario"] + "^#contato" });
    
asked by anonymous 11.11.2016 / 13:36

1 answer

0

Try to use \ # because the backslash tells your framework that this is a text and not a character reserved by the language leaving it like this: "#contact" and just a note, you have placed a caret in your code in ^ # contact and maybe this is your problem, so I do not think you'll even need the backslash

return RedirectToAction("index", "Representante", new { id = Session["IdPaginaUsuario"] + "\#contato" });
    
19.11.2016 / 19:51