Skip to main content
added 5 characters in body; edited tags
Source Link
Richard Seal
  • 20.8k
  • 5
  • 44
  • 79
<a href="https://google.com" class="link" ></a>   

<a href="https://google.com" class="link" >Text Node</a>


@using (Html.Glass().BeginRenderLink(m => m.Link, new { @class = "link" }, true))
{
                
}
            
@Html.Glass().RenderLink(m => m.Link, new { @class = "link" }, true)

I can't understand this odd behavior, using BeginRenderLinkBeginRenderLink renders the first anchor link without a text node, but using RenderLinkRenderLink renders the same anchor link but with a text node. Is there something I'm missing here? The end goal is to be able to wrap some HTML inside the using statement but I am stuck on this little problem.

<a href="https://google.com" class="link" ></a>   

<a href="https://google.com" class="link" >Text Node</a>


@using (Html.Glass().BeginRenderLink(m => m.Link, new { @class = "link" }, true))
{
                
}
            
@Html.Glass().RenderLink(m => m.Link, new { @class = "link" }, true)

I can't understand this odd behavior, using BeginRenderLink renders the first anchor link without a text node, but using RenderLink renders the same anchor link but with a text node. Is there something I'm missing here? The end goal is to be able to wrap some HTML inside the using statement but I am stuck on this little problem

<a href="https://google.com" class="link" ></a>   

<a href="https://google.com" class="link" >Text Node</a>


@using (Html.Glass().BeginRenderLink(m => m.Link, new { @class = "link" }, true))
{
                
}
            
@Html.Glass().RenderLink(m => m.Link, new { @class = "link" }, true)

I can't understand this odd behavior, using BeginRenderLink renders the first anchor link without a text node, but using RenderLink renders the same anchor link but with a text node. Is there something I'm missing here? The end goal is to be able to wrap some HTML inside the using statement but I am stuck on this little problem.

Source Link

Glass BeginRenderLink not showing text node

<a href="https://google.com" class="link" ></a>   

<a href="https://google.com" class="link" >Text Node</a>


@using (Html.Glass().BeginRenderLink(m => m.Link, new { @class = "link" }, true))
{
                
}
            
@Html.Glass().RenderLink(m => m.Link, new { @class = "link" }, true)

I can't understand this odd behavior, using BeginRenderLink renders the first anchor link without a text node, but using RenderLink renders the same anchor link but with a text node. Is there something I'm missing here? The end goal is to be able to wrap some HTML inside the using statement but I am stuck on this little problem