HTML embedded in C # dot net visual studio

0

I need to generate dynamic HTML in a C # application implemented in Visual Studio.

In this case, I need to display the li tag as logged in user.

The code is:

<%if (Session["usuario"] != null) {
    <li><a href="<%= ResolveUrl("~/Paginas/Contratos.aspx") %>">
        <img src="<%= ResolveUrl("~/images/chama.png") %>" class="chama" />
        <span>Contratos</span></a><br class="clear" />
    </li>
}%>
    
asked by anonymous 09.07.2015 / 20:30

1 answer

0

Try the following:

<li> <%= ((Usuario)Session["usuario"]).Nome %> <li/>

Where Usuario is the type of data contained in the Session "user" and Nome is the property that is in the Usuario class.

    
09.07.2015 / 20:35