3
I have two _Shared.cshtml
(MVC masterpage type, do not know the name) and both are virtually equal, only the menu left is different.
I would like to do only 1 and according to the querystring I will call the page I want to be the menu: ex
@if (Request.FilePath.Contains("Home"))
@ { $("#IDMenu").load('menu_Home.html'); }
@ else
@ { $("#IDMenu").load('menu_Admin.html'); }
Something like that.
Basically today my application has 2 url
localhost:47123/home/
or
localhost:47123/Admin/
If you are Admin I want you to call menu_admin.html if you are home will call another page.
I don’t know how to use the Razors.
what would be this <text> tag? I’ll test, but it looks like that’s it
– Dorathoto
That tag
<text>
serve to send to the client all the text that is between<text>
and</text>
, untouched by the server ;)– carlosrafaelgn
another detail.my url http://localhost:47123/Home/contacts_view? id=1 @if (Request.QueryString.Allkeys.Contains("Home")) { esta dando false, was not supposed to find?
– Dorathoto
Actually, no. Because his
QueryString
, in that case, and onlyid=1
. However, the propertyRequest.Path
would return to you"/Home/contatos_visualizar"
– carlosrafaelgn