I can't get templateUrl to work - asp.net

I'm new to Angular and I'm using Angular-UI-Router with ASP.NET MVC 4.
app.config(['$urlRouterProvider', '$stateProvider', function ($urlRouterProvider, $stateProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('about', {
url: '/',
template: 'HELLO WORLD'
});
}]);
this works fine. HELLO WORLD is displaying so i know that everything is set up rather correctly.
but when i try templateUrl instead of template say:
app.config(['$urlRouterProvider', '$stateProvider', function ($urlRouterProvider, $stateProvider) {
$urlRouterProvider.otherwise('/'); //if you go to incorrect url it'll go back to home
$stateProvider
.state('about', {
url: '/',
templateUrl: 'Home/About.html'
});
}]);
nothing displays. I'm using almost a clean slate default template from scratch.. picking the "Internet Application" from default templates.. in my directories i have
Views --> Home --> About.html
I also have About.cshtml and I've tried that and it doesn't work neither. Help please!

ASP.NET MVC Views doesn't allow direct access to .html files of it. You need to allow the access from the web.config by adding handlers in system.webServer
Code
<system.webServer>
<handlers>
<add name="JavaScriptHandler" path="*.js" verb="*"
preCondition="integratedMode" type="System.Web.StaticFileHandler" />
<add name="HtmlScriptHandler" path="*.html" verb="*"
preCondition="integratedMode" type="System.Web.StaticFileHandler" />
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
Or the other way around would be you could create one new static folder other than Views that will have an html files in it. You could directly access the URL eg. static/about.html
For more details refer this Answer

Related

asp.net web pages. Default route

How I can set up my site (asp.net web pages) to get urldata for default page?
site.com/default/1
this work,
but site.com/1 return 404 error.
In web forms this work fine, but in web pages no
In Solution Explorer, there is a file called as App_Start. You can configure RouteConfig.cs file whatever you want. There is the example of Route function :
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
If you have a default.cshtml that is always the default start page, even if it´s not listed in the list with default pages under Settings. I guess it´s because how the routing works in ASP.NET Web Pages.
If you want a index.html as start page, you need to add it to the list with default pages, and remove the default.cshtml if you have that.
see This link
<defaultDocument enabled="true">
<files>
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
<add value="iisstart.htm" />
<add value="default.aspx" />
</files>
</defaultDocument>
Here Similar Post

Prevent access to aspx files and allow access only via routing?

I have a url route which I declare at global.asax file :
routes.MapPageRoute("RouteAdmin", "Admin/{Url}", "~/pages/MyPage.aspx", false);
But if the user tries to access mysite.com/pages/MyPage.aspx he can still see the page
Question :
Can I configure routing so that only routed paths are acceptable ?
In ASP.NET MVC views are not accessible directly by defining them using a not found handler:
<system.web>
<httpHandlers>
<remove verb="*" path="*.aspx" />
<add path="*.aspx" verb="*" type="System.Web.HttpNotFoundHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="BlockViewHandler" path="*.aspx" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
Found it.
If I access directly to the aspx file so I can check this prop:
Page.RouteData.RouteHandler is null
where
if I use route url it is not null :
{System.Web.Routing.PageRouteHandler}
Edit
(better solution)
Add those 2 lines to global asax
routes.MapPageRoute("Route", "{*.}", "~/pages/default.aspx", false );
routes.RouteExistingFiles = true;

ASP.NET Ajax client-side framework failed to load. when put the ScriptManager on a blank page

I have an error Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load. on a blank page using masterpage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableCdn="True">
</asp:ScriptManager>
</form>
</body>
</html>
This is what it render it the end
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title></head>
<body>
<form method="post" action="WebForm2.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNjE2OTgwNTY5ZGTfWA/dEX85PXBlbkKsVxeLKyIn+mJQ9piW5cbeNE+qww==" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<script src="http://ajax.microsoft.com/ajax/4.0/2/WebForms.js" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=6x_aX-LOcgUU-O_K6nM7ST5ViC_naT1e4_j-CY35ASRLpcKYpiapwTARuePHvx3llP-Xhl_AG_ubpM1BzkM5iyn9ThB3m7lmXKvkck0cxTcYiT-VbeKgamKxp9EwxBUyIQN6sSCU9SQm3tMtmzQWRg2&t=ffffffffbad362a4" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>
</script>
<script src="/ScriptResource.axd?d=khKEuZ4oUqBYvQxJ1ISpPVIW8_AWWc907q5_v74DI2ruWKTJpldq2osxPkAZ__hffe1Q6HTQUyTbL3Q1mD6MX7V65O5ibxKwb4NvN6ycdZ8vEJ-bz51MO-8uoaP2xioK6npm5n8vldI1d0sOCnH6yw2&t=ffffffffbad362a4" type="text/javascript"></script>
<div>
</div>
<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ScriptManager1', 'form1', [], [], [], 90, '');
//]]>
</script>
</form>
</body>
</html>
The problems might be that i used to have AjaxControlToolkit in my project but later i use jquery instead. so somewhere in the project might try to add Ajaxcontroltoolkit which i can't find it. i don't know how to fix this error. i have tried to add bin file of ajaxcontroltoolkit back but it seems to not work.
this solution works for me:
The error on client was:
SCRIPT5022: ASP.NET Ajax client-side framework failed to load.
SCRIPT5009: 'Sys' is undefined
After many time to mining the websites, and more solutions, i solve the problem:
the solution for .NET 4.0 is:
Set EnableCdn property of script manager to true, Like this:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableCdn="true">
Next Solution and Better Solution is:
add this handler to your web.config
<system.webServer>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
Sys undefined means that you're not getting the client side files loaded on your browser.
Solution 1:
<add verb="GET"
path="ScriptResource.axd"
type="Microsoft.Web.Handlers.ScriptResourceHandler"
validate="false"/>
Solution 2: If you don't have this, add this too under <assemblies>
<add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Solution3: If that doesn't work too, try deleting files from your "bin" folder and rebuild the solution and clear the cache of your browser.
Solution 4: Add this to your web.config
<location path="ScriptResource.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
for telerik web resources use this code:
<location path="Telerik.Web.UI.WebResource.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
I had enabled WebForms Routing and forgot to add the exception for resources:
routes.Ignore("{resource}.axd/{*pathInfo}");
Another possible cause is script combining/compression in IE 8 & 9. In web.config at the top level (within Configuration), put
<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression="false" enableCaching="true" />
</scripting>
</system.web.extensions>
On your ToolKitScriptManager put CombineScripts=False, e.g.
<asp:ToolkitScriptManager runat="server" CombineScripts="False">
</asp:ToolkitScriptManager>
see http://robmzd.blogspot.com/2010/02/invalid-character-error.html which is where I figured out the problem
Add EnableScriptCombine="False" to your RadScriptManager as follows:
<telerik:RadScriptManager ID="RadScriptManager1" EnableScriptCombine="False" runat="server" />
I had this problem when I moved my forms to a new server. I spent hours to find the solution.
The problem was that the new server has ASP.NET 4.0 and my web.config was ASP.NET 3.5. So I made a new web.config and everything is ok now.
Simply add the <handlers> section as shown below in your web.config within <system.webServer> and this will fix the problem in no time.
<system.webServer>
.
.
.
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
For me it was the problem with Global.asax code,
Just check below condition before validating session in Application_PreRequestHandlerExecute
Request.Path.ToUpper() != Constants.AliasName.ToUpper() + "SCRIPTRESOURCE.AXD"
Functional code is shown below,
protected void Application_PreRequestHandlerExecute(Object sender, EventArgs e)
{
if ((Request.Path != Constants.DebugLoginUrl) &&
(Request.Path != Constants.SessionTimeOut) &&
(Request.Path.ToUpper() != Constants.AliasName.ToUpper() + "TRACE.AXD") &&
(Request.Path.ToUpper() != Constants.AliasName.ToUpper() + "SCRIPTRESOURCE.AXD"))
{
// to prevent check of HTTP HANDLER FLUSH - Session State is Invalid
if (HttpContext.Current.Session != null)
{
if (Session[Constants.personId] == null)
{
//your code
}
else
{
Response.Redirect(Constants.SessionTimeOut);
}
}
}
In my case the Ajax loading error occurred only if I reloaded the page, not when the page was loaded for the first time.
Looking at the content in the tag in Site.Master, I noticed that only some of the items had Path attribute set. So, I updated MsAjaxBundle to this: and the problem went away. I also had to modify the WebFormsBundle the same way and now reloading the page works.
What worked for me was to download ASP.NET Ajax from Microsoft.
You might also need to explicitly browse for the correct dll version when you add reference e.g.
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Web.Extensions.dll
I set Application Pool as ASP.NET 4.0 Classic during installation.
well i just changed RadScriptManger to Simple asp:ScriptManager and it works
Before:
<telerik:RadScriptManager ID="RadScriptManager1" EnableCdn="true" runat="server" />
After
<asp:ScriptManager ID="scrReg" EnablePartialRendering="true" runat="server"></asp:ScriptManager>
Hope it helps
And here's another cause. I installed MySQL Connector/net 6.9.5. Later I started getting the dreaded 'sys undefined' for everything in some, but not all, projects in IE. Many, many hours later I tried Chrome and Opera and the first page opened fine but on post back all the session variables had vanished. That's when the penny finally dropped - Connector/net must have set itself up the session state provider but I had nothing for session state in web.config for the failing projects. Sessionstate inproc fixed it immediately. At least I think that's what happened...
In my case, I had ended up with the mentioned handlers in <httpHandlers> as well as in <handlers>.
Removing the <httpHandlers> section fixed it.
After adding System.Web.MVC reference to my ASP.NET and added default route in global.asax
i.e.
RouteTable.Routes.MapRoute("Default", "{controller}/{action}/{id}",
new { controller = "new", action = "Index", id = "" });
}
Started getting the error
Added below line to global.asax.cs to resolve it
RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
For anyone working with the Visual Studio 2015 ASP.NET 4.5 WebForms Web Application project template which bundles the ASP.NET AJAX scripts:
https://stackoverflow.com/a/47673606/313935
for me web config was correct.
if web config is correct then.
check your IIS App pool settings in my case App pool pipeline was selected as the classic I made pipeline integrated and it started working.
Go to iis -> rightclick on your application pool -> advance settings ->
Managed Pipelined Mode -> "integrated" -> ok
I am using Visual Studio 2015 ASP.NET 4.5 Web Forms Web Application project and apparently a bad route in an API Controller will also cause this error. I fixed the route and the error went away.
It certainly would be nice for a more descriptive error message as to why the client framework won't load. I spent hours checking web.config settings, clearing the .net temporary directories, checking global.ascx, etc.. The strange thing is while IE 11 died while loading default.aspx, chrome was able to load default.aspx and the web site.
Try changing on the web.config the compilation to false:
<compilation debug="false" targetFramework="4.5">
If none of these answers work for you then you might be in my situation.
Ok, so for me the issue was caused by the ssl certificate expiring today, so after I renewed it then these errors went away.

JQuery to asmx fails on Windows 2008 R2 SP1

Since the installation of SP1 we are facing problems in calling asmx pages from JQuery client code.
IIS is pointing the JQuery post call to his default 404 page.
We did a roleback of our environment to assert this issue is caused by SP1 and tests confirm it.
Waiting for a fix #MS
Technologies used:
ASP.Net 4.0 -
JQuery -
IIS 7.5 -
Windows 2008 R2 SP1
--Bart
Code Sample calling (front-end):
// Code to load vars...
$.ajax({
type: "POST",
url: "/Handlers/ProductRating.asmx/RateProduct",
data: "{'uniqueId':'" + uniqueId + "','productId':'" + productId + "','points':" + points.toString() + ",'showOwnScore':" + showOwnScore.toString() + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
alert('success');
},
failure: function(msg) {
alert('something went wrong');
}
});
}
Code back-end:
[ScriptService]
public class ProductRating : System.Web.Services.WebService
{
[WebMethod(EnableSession=true)]
public RateProductResponse RateProduct(Guid uniqueId, Guid productId, int points, bool showOwnScore)
{
//Implementation
}
Snapshot1 : With SP1:
http://img812.imageshack.us/i/capture2r.png/
Snapshot2 : Without SP1:
http://img190.imageshack.us/i/capture1qx.png/
I was able to get this working with the following addition to my web.config
I saw another site that suggested clearing the handlers, but that made everything way worse. With this update, I was able to call my web services once again.
<system.webServer>
<handlers>
<add name="AsmxRoutingHandler" verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
I had the same problem.
Create a Web.Config file containing the following lines:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.web>
<httpHandlers>
<clear />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add path="*" verb="GET,HEAD,POST" type="System.Web.DefaultHttpHandler" validate="True" />
</httpHandlers>
</system.web>
</location>
</configuration>
Copy this into the directory(s) where you serve out your affected scripts, and restart your web server.
These lines will override your preferred HttpHandlers and set it to use the default handlers instead.
Good luck!
Judging by your screenshots, that seems an awful lot like a URL rewriting issue. Does your site have any overly-greedy URL rewrite rules at the IIS level that could be 302 redirecting /Handlers/ProductRating.asmx/RateProduct?
If you do have rewrite rules, can you try disabling them temporarily to see if that fixes the ASMX issue?

How can I implement a site with ASP.NET MVC without using Visual Studio?

I have seen ASP.NET MVC Without Visual Studio, which asks,
Is it possible to produce a website based on ASP.NET MVC, without using Visual Studio?
And the accepted answer is, yes.
Ok, next question: how?
Here's an analogy. If I want to create an ASP.NET Webforms page, I load up my favorite text editor, create a file named Something.aspx. Then I insert into that file, some boilerplate:
<%# Page Language="C#"
Debug="true"
Trace="false"
Src="Sourcefile.cs"
Inherits="My.Namespace.ContentsPage"
%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Title goes here </title>
<link rel="stylesheet" type="text/css" href="css/style.css"></link>
<style type="text/css">
#elementid {
font-size: 9pt;
color: Navy;
... more css ...
}
</style>
<script type="text/javascript" language='javascript'>
// insert javascript here.
</script>
</head>
<body>
<asp:Literal Id='Holder' runat='server'/>
<br/>
<div id='msgs'></div>
</body>
</html>
Then I also create the Sourcefile.cs file:
namespace My.Namespace
{
using System;
using System.Web;
using System.Xml;
// etc...
public class ContentsPage : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Literal Holder;
void Page_Load(Object sender, EventArgs e)
{
// page load logic here
}
}
}
And that is a working ASPNET page, created in a text editor. Drop it into an IIS virtual directory, and it's working.
What do I have to do, to make a basic, hello, World ASPNET MVC app, in a text editor? (without Visual Studio)
Suppose I want a basic MVC app with a controller, one view, and a simple model. What files would I need to create, and what would go into them?
ok, I examined Walther's tutorial and got a basic MVC site running.
The files required were:
Global.asax
App_Code\Global.asax.cs
App_Code\Controller.cs
Views\HelloWorld\Sample.aspx
web.config
That's it.
Inside the Global.asax, I provide this boilerplate:
<%# Application Inherits="MvcApplication1.MvcApplication" Language="C#" %>
And that MvcApplication class is defined in a module called Global.asax.cs which must be placed into the App_Code directory. The contents are like this:
using System.Web.Mvc;
using System.Web.Routing;
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{arg}", // URL with parameters
new { // Parameter defaults
controller = "HelloWorld",
action = "Index",
arg = "" } );
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
}
}
The Controller.cs provides the logic to handle the various requests. In this simple example, the controller class is like this:
using System.Web.Mvc;
namespace MvcApplication1.Controllers
{
public class HelloWorldController : Controller
{
public string Index()
{
return "Hmmmmm...."; // coerced to ActionResult
}
public ActionResult English()
{
return Content("<h2>Hi!</h2>");
}
public ActionResult Italiano()
{
return Content("<h2>Ciao!</h2>");
}
public ViewResult Sample()
{
return View(); // requires \Views\HelloWorld\Sample.aspx
}
}
}
The Controller class must be named XxxxxController, where the Xxxxx portion defines the segment in the URL path. For a controller called HelloWorldController, the URL path segment is HelloWorld. Each public method in the Controller class is an action; the method is called when that method name is included in another segment in the url path . So for the above controller, these URLs would result in invoking the various methods:
http:/ /server/root/HelloWorld (the default "action")
http:/ /server/root/HelloWorld/Index (same as above)
http:/ /server/root/HelloWorld/English
http:/ /server/root/HelloWorld/Italiano
http:/ /server/root/HelloWorld/Sample (a view, implemented as Sample.aspx)
Each method returns an Action result, one of the following: View (aspx page), Redirect, Empty, File (various options), Json, Content (arbitrary text), and Javascript.
The View pages, such as Sample.aspx in this case, must derive from System.Web.Mvc.ViewPage.
<%# Page Language="C#"
Debug="true"
Trace="false"
Inherits="System.Web.Mvc.ViewPage"
%>
That's it! Dropping the above content into an IIS vdir gives me a working ASPNET MVC site.
(Well, I also need the web.config file, which has 8k of configuration in it. All this source code and configuration is available to browse or download.)
And then I can add other static content: js, css, images and whatever else I like.
You would do exactly what you did above, because you wouldn't use a model or controller in a hello world app.
All visual studio does is provide you with file creation wizards, so in theory, all you need to do is create the right files. If you want detailed specifications for the MVC project structure, good luck, most documentation is written on the assumption you are using visual studio, but you might be able to go through a tutorial step by step, and puzzle it out.
Your best bet is to find a downloadable demo project, use visual studio to reverse engineer the project structure, or try one of the open source .net IDE.
Well, this is how the default VS skeleton for an MVC 1.x app looks like:
Content
Site.css
Controllers
AccountController.cs
HomeController.cs
Models
Scripts
(all the jquery scripts)
MicrosoftAjax.js
MicrosoftMvcAjax.js
Views
web.config
Account
ChangePassword.aspx
ChangePasswordSuccess.aspx
LogOn.aspx
Register.aspx
Home
About.aspx
Index.aspx
Shared
Error.aspx
LogOnUserControl.ascx
Site.master
Default.aspx
Global.asax
web.config
Dunno if that's what you're looking for... the key here is obviously the web.config file.
Note: if you added namespace you must have an assembly.
web.config example for Cheeso example project on opensuse linux under mono project.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
</configSections>
<appSettings>
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<!-- <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> -->
</assemblies>
</compilation>
<authentication mode="None"></authentication>
<pages>
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<!-- <add namespace="System.Web.Helpers" />
<add namespace="System.Web.WebPages" /> -->
</namespaces>
</pages>
<httpHandlers>
<add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" />
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<add name="dotless" path="*.less" verb="*" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<dotless minifyCss="false" cache="true" web="false" />
</configuration>

Resources