Home how to remove a html tag using Razor
Reply: 1

how to remove a html tag using Razor

moris1983 Published in 2018-02-09 15:08:47Z

hey guys I have tag which I want to remove it with razor,posiible?

 <div id="branding">
        <img alt="stl" src="@Url.Content("pic"/>
        @if (Request.IsAuthenticated)
      ....remove the above <img> tag
DavidG Reply to 2018-02-09 15:09:51Z

You don't remove it, you just don't output it in the first place:

<div id="branding">
    @if (!Request.IsAuthenticated) <!-- Note the ! here -->
        <img alt="stl" src="@Url.Content("pic")/>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.326276 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO