Solved

Razor not working

Posted on 2014-04-11
2
63 Views
Last Modified: 2015-01-09
Hello Experts,

Just built a Windows Server 2008 R2 server. Turned on
IIS and installed dot.net framework.

<%@ Page language="C#" %>
<html>
<head>
<title>Testing ASP.NET and C#</title>
<style type="text/css">
body {font-family: arial;
span.Text1 {font-size:24px;}
 </style>
</head>
<body>
<h2>Testing ASP.NET and C#:</h2>

Today's Date:
<%=DateTime.Now.ToString()%>
</body>
</html>

Open in new window


returns

Testing ASP.NET and C#:
Today's Date: 4/11/2014 1:26:49 PM 

Open in new window


So I know asp.net is working.

Was trying to do some Razor

Wrote
<!DOCTYPE html>

<html lang="en">
<head>
     <meta charset="utf-8" />
     <title>Web Pages Demo</title>
</head>
<body>
     <h1>Hello Web Pages</h1> 
     <p>The time is @DateTime.Now</p>
</body>
</html> 

Open in new window


This returns

Hello Web Pages
The time is @DateTime.Now

Open in new window


So the Razor is not working. Is there a library I need to install
or something I need to turn on to get it going? The tutorial says
'Razor has the power of traditional ASP.NET markup, but is easier to learn, and easier to use'. It seems to indicate that it works off of the dot net framework as  but
I am not having any luck.

Thanks.

Allen in Dallas
0
Comment
Question by:9apit
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
...installed dot.net framework.
What version of the .NET Framework?
0
 

Author Comment

by:9apit
Comment Utility
Hello Kaufmed,

The Registry Editor says 'Net Framework Setup' v3.5.

(I looked in Control Panel > Programs and Features
and could not find it. Should it not be in there?
It is on my Windows 7 machine. Maybe its different on a
server.)

Allen
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now