Home Alternative request uri in c# (cshtml)
Reply: 0

Alternative request uri in c# (cshtml)

user6222
1#
user6222 Published in September 19, 2018, 7:00 pm

I looking for help with C# (cshtml) if statement, to display paragraph on only homepage site, like in php.

<?php
    if ($_SERVER['REQUEST_URI']=='/')
    {
        echo('<p>something</p>');
    }
?>   

Thanks in advance

share|improve this question
  • Hint: Use Request.Url or Request.UrlReferrer property to get requested URL. – Tetsuya Yamamoto Nov 14 '17 at 7:59
  • @if (Request.Url == '/') { <p>something</p> } - something like this ? – R.J.G Nov 14 '17 at 8:00

1 Answer 1

active oldest votes
up vote 0 down vote
You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO