I have found these threads: thread1, thread2, and thread3 but it's not answering my question. I am creating a master page but all the navigation menus are coming from an absolute path. In the past I have downloaded the .html file and used SSI but if there is a change in the navigation menu, I do not have the latest menu. So, what are my alternatives? I need the capabilities similar to SSI but using absolute path pointing to a http://mydomain.com/myMenu.html file.
Asked
Active
Viewed 477 times
1 Answers
1
The reason this does not work (based on your comments) is that you're trying to do a server side include from a different website. That just won't fly because it's a security risk. In fact, that's a technique that phishing sites would love to be able to do.
What you could do is a WebRequest to download the HTML from the other site and then embed it as a literal on your page. Do this during the Page_Load method. This gets around the need for Server Side Includes.
When you say the navigation menu is "done by someone else", are they part of your team? If so, it'd be a good idea to host the navigation menu as a custom user control (.ascx) on your site. Then you can embed that user control in your master page.

mason
- 31,774
- 10
- 77
- 121
-
Many thanks for the explanation and response. The navigation is done from the main department. So here's what file structure looks like: Main site: http://www.mainSite.com/ My site: http://www.mainSite.com/mySite The nav.html is located in http://www.mainSite.com/ssi/nav.html I have also used ssi with relative path by ../ssi/nav.html; however, my biggest problem is that when I test my site on my local machine or personal web server, it does not work because there is no nav.html at location ../ssi/ that is why I thought of using an absolutely path so that it will work anywhere. – 2myCharlie Dec 18 '13 at 17:37
-
Will somebody show me or link me to a instruction how to format in here? I'm having issue with putting link or codes in here. My above file structure link got removed when displaying. – 2myCharlie Dec 18 '13 at 17:38
I wanted something like this:
But that does not work. – 2myCharlie Dec 18 '13 at 16:36