Show view with variable content mvc [closed]

1

Good day I need help in the following, I am working with mvc I want to have a news section and when I click on "Read more" I load a partial view but on another page, which content is variable according to the link that I select, I have tried to send an id with javascript and receive it in the control, but I do not have good results please help me

<div>
<h4> Noticias</h4>
<div>
    noticia 1
    <a href="#" id="leerA"><span>Leer más</span></a>
</div>
<div>
    noticia 2
    <a href="#" id="leerB"><span>Leer más</span></a>
</div>
<div>
    noticia 3
    <a href="#" id="leerC"><span>Leer más</span></a>
</div>

I assume that something like this should have, to find the news that I need but I can not send the code from the view of my main page

 public ActionResult Noticias(string codigo)
    {
        ListaNoticias.Find(c => c.Id.Equals(codigo));
        return PartialView("Noticias", noticia);
    }

Any help is appreciated

    
asked by diversiondj 01.07.2016 в 16:25
source

1 answer

0

For these cases we usually use HTMLHELPER which is a class with methods in which you build an html code to paint it in the view.

ways to create Custom Html Helper in ASP.NET MVC

    
answered by 13.10.2016 в 08:49