Link to home
Start Free TrialLog in
Avatar of Bembi
BembiFlag for Germany

asked on

Visual Studio Web Development - HTML

Hello together,
I have some plain websites created with plain HTML.
Inside the web pages, I use a webbot to inmclude header and footers into the page....
 <!-- webbot bot="Include" u-include="de/xHeader.htm" tag="BODY" -->

This works fine in Expression Web 4.
In the tool I see only the webbot, Preview is fine, the saved file contains the included page as code between a startspan and endspan.

<!--webbot bot="Include" tag="BODY" u-include="de/xHeader.htm" startspan -->
... included html code
<!--webbot bot="Include" endspan i-checksum="51014" -->


When I open the web site in Visual Studio (HTML web Forms Editor), the preview is fine.
When I open the web site in Visual Studio (HTML Editor), there is no preview...
The code view is equal to Expression web...
When VS saves the file, it saves it like it is shown in the code. So the webbot is just written into the file but the code of the source is not there. .
This results into a page, where all included files (headers, footers) are missing.

Have I overseen something in Visual Studio, or can Visual Studio just not deal the the webbot?
IF VS cannot do this anymore, do we have a alternative?
Or has it something to do with the <!DOCTYPE HTML>, what is interpreted as HTML5 in VS?
Avatar of Francisco Igor
Francisco Igor
Flag of Canada image

The webbot directives are not processed in the html editor (treated as simple HTML comments).
This directives are applied when running over the web server (IIS) with webbot extension activated.
Check the resulting source code to ensure the <!-- webbot > lines are still here without changing.
Avatar of Bembi

ASKER

Not exactly...
I used this before for years with different tools, lately with Expression Web 4
The server doesn't support Frontpage Extensions (Unix) and never did.
But looking into the notepad files explains, why it is not needed.

As you can see, Expression Web puts the included code into the resulting html file, Visual Studio doesn't not.

Attached you see the results from Expression Web (EX_) and Visual Studio (VS_)

My question is now, can I tell Visual Studio somehow to do the same than Expression Web?
Different template, different settings ??
EX_Code.PNG
EX_Preview.PNG
EX_Browser.PNG
EX_Notepad.PNG
VS_Code.PNG
VS_Preview.PNG
VS_Browser.PNG
VS_Notepad.PNG
ASKER CERTIFIED SOLUTION
Avatar of Francisco Igor
Francisco Igor
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bembi

ASKER

OK, I will check if I have missed something.
But the article is older and I'm just searching if I find a similar setting in VS2012 / VS 2015
Yes, it's older. The goal is enable the Frontpage Extensions in the OS web server (IIS)
Most modern windows-based OS have this feature disabled by default.
Try searching for how to enable Frontpage Extensions in IIS for the version of your current OS

For example:
http://www.iis.net/downloads/community/2011/07/rtr-frontpage-server-extensions-for-iis-75-on-windows-server-2008-r2-and-windows-7
For win7/Server2008 servers using  IIS7.5 server
Avatar of Bembi

ASKER

As stated in https://support.microsoft.com/en-us/kb/184021
web bot includes doesn't need server extensions....
This is a client functionality...
As you can see in the pictures, the html files from Expression contain the included code, the html files from visual studio doesn't  not.  

I just created my VS project a bit different, following some hint from your first link....
Now I can see the correct include also in the (first) browser preview a well...
If I refresh the link in the preview , the content is away again...

So Visual Studio seems to understand the web bot include, shows it in the browser preview and tool preview box, but if the file is saved, nothing in in there. (The comments are just there like in the code, and the server does nothing with it of course).

So I'm missing a setting which tells visual studio to write the included code into the resulting html file (like expression is doing it). But I can not find anything anywhere what may give me this option.
Avatar of Bembi

ASKER

Hello Frigor,
I will close this question now, but havn't found a solution until now, maybe there is none.
While Expression "compiles" the webbot bot="Include" into the html file...
Visual Studio doesn't do, nevertheless it show the correct preview.

So will award you for taking the time to support.
Thank you for participation.