Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi everyone,
I was wondering, if it is possible to hide partial views by URL part? For example:
www.example.com/example
for the full page, and:
www.example.com/example?hidefooter=1
to show the same page, but without the footer? And that I could use this URL in an IF-THEN-ELSE clause to hide the partial view?
Thanks everyone! Simeon
In your partial you could just write something like:
@if (Request.QueryString["hidefooter"] != null && int.Parse(Request.QueryString["hidefooter"]) == 1) { <footer></footer> }
Hi Steve,
Thanks a lot for your reply!
I just tried that, but unfortunately it doesn't work. There is no difference, if I try with or without ?hidefooter=1.
This is my code:
@if (Request.Params["hidefooter"] != null && int.Parse(Request.Params["hidefooter"]) != 1) { <footer></footer> } else { (my footer code) }
Is this correct?
Thanks!
Sorry - didn't engage the brain before posting. I've updated the code snippet - there were two errors there :)
That worked, thanks! :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Hide partials by URL part?
Hi everyone,
I was wondering, if it is possible to hide partial views by URL part? For example:
for the full page, and:
to show the same page, but without the footer? And that I could use this URL in an IF-THEN-ELSE clause to hide the partial view?
Thanks everyone! Simeon
In your partial you could just write something like:
Hi Steve,
Thanks a lot for your reply!
I just tried that, but unfortunately it doesn't work. There is no difference, if I try with or without ?hidefooter=1.
This is my code:
Is this correct?
Thanks!
Sorry - didn't engage the brain before posting. I've updated the code snippet - there were two errors there :)
That worked, thanks! :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.