I am faced with a situation where I have two masterpages - one named main.Master and the other search.Master.
The search.Master is actually a nested masterpage, residing within the main.Master. In order to ensure that my CSS files function properly with these masterpages, I had to add the runat="server" attribute. This means including it in this manner:
<link runat="server" href="~/mp/css/master.main.css" rel="stylesheet" type="text/css" />
Everything seems to be working perfectly fine within the masterpage. However, as expected, the nested masterpage has its own set of styles. To address this, I attempted to use the runat="server" technique once again. Making sure that my asp:content was placed correctly, I added the following code:
<link runat="server" href="~/mp/css/master.search.css" rel="stylesheet" type="text/css" />
Upon reviewing the source code of my website, I noticed that the path displayed was:
~/mp/css/master.search.css
instead of:
../../mp/css/master.search.css
Does anyone know why this discrepancy is occurring? And most importantly, how can it be resolved?
PS: I am trying to avoid using <%= ResolveClientUrl("bla bla bla") %>, as it interferes with the relationship between the masterpage and theme. Additionally, I would prefer not to insert the CSS stylesheets directly into the header from the ServerSide code.