WebMatrix :: Why Is "default.cshtml" Automatically Recognized As Default Page In IIS Express Server
Feb 4, 2011
When i created a simple site via Matrix which adopts Razor technology by default, i found site automatically display "default.cshtml" if started through "http://localhost:xxxx/bread/" ; however i hadn't set "default.cshtml" as "default document" for this site, even i seek in the "applicationhost.config" i just find
<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>
which apparently hasn't "...cshtml" yet. So I am wondering now why in this case the web server actively sets "default.cshtml" as default start page ?
View 5 Replies
Similar Messages:
Feb 24, 2011
I have been struggling to get WebMatrix to serve any cshtml files. I performed a fresh install of WebMatrix, then started a tutorial which involves creating one small cshtml file. Whenever I try to run the site, I get the following error:
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. review the URL below and make sure that it is spelled correctly.
Requested URL: /Home.cshtml
I tried reinstalling to no avail.
I am running Windows 7 Pro, with IIS 7 installed. (IIS Express is supposed to be able to run side-by-side no problemo)
View 8 Replies
Aug 16, 2010
Created a site using the StarterSite template in WebMatrix and am trying to change the default login page url from Account/Login.cshtml to /Signin.cshtml. I've tried setting the loginUrl under the authentication section in web.config to no avail
View 5 Replies
Aug 16, 2010
I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.
I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.
View 3 Replies
Nov 23, 2010
I have 2 instances of SQL Express installed:
SQL 2005 -> .SQLEXPRESS
SQL 2008 R2 -> .SQL2008
I have Visual Studio 2010 configured to use .SQL2008 by default in Tools->Options->Database Tools. In Server Explorer, it tells me that it's connecting to the database via 2008.
However, when I run an ASP.NET sample I downloaded (that has it's own ASPNETDB.MDB file), I get a version error (612 vs. 655). I understand that means it's connecting to the 2005 instance instead of the 2008 instance.
How can I make it connect to the 2008 instance? The web.config file has no connection strings, so everything is default.
View 3 Replies
Jul 28, 2010
I have created a web application. I have a page "Default.aspx" and some other page say"test.aspx". In test.aspx, I am setting some values in a collection object and then setting this object in session. I am not getting but somehow during execution of test.aspx, the default.aspx gets called where the session containing object gets reset. Its very important for me to know whey this default.aspx gets called even I am not making any call to it. I have other pages also like a.aspx,b.aspx, c.aspx, d.aspx and many more. All other pages work fine.
View 5 Replies
Aug 10, 2010
That subject may not do this questions justice.
I am trying to limit what I write on all my .cshtml pages. For example, on everypage I am @using myDLL and "connecting" to sql server.
I write that out like
@using System.myDLL;
@{
myDLL dll = new myDLL();
dll.ConnectionString = "blablabla";
}
How can I remove the need to do that to every single page? I think I can create a web.config and do some funky stuff... can someone show examples?
View 13 Replies
Feb 15, 2011
There I was, happily coding webpages, when suddenly it wouldn't run them anymore. Now when I click run I get an error message that looks like this: Server Error in '/' Application.This type of page is not served. Description:The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /quiz/intro.cshtml
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
View 3 Replies
Jul 15, 2010
How does one create new sites in your own custom directory? Can it be added as a feature?
View 2 Replies
Sep 18, 2010
Here is my scenario.In default.aspx page user selects the country, state, city from drop down list, and store them in cache for further use. but when other user open the web site from other computer it shows the same country, state, and city selected by user 1. Is there any problem related to cache? I have stored data as following.
cache["ctryID"] = ctryID;
cache["stateID"]= stateID;
cache["cityID"]= cityID;
I want to show default country, state , city at page load of default.aspx
View 2 Replies
Jul 11, 2010
It's unfortunate that Microsoft WebMatrix (beta) doesn't recognize that files has been modified. I suggest you implement a feature similar to Visual Studio, allowing the user to decide what to do if the file has been modified outside WebMatrix. Especially when you have a button to launch the project in Visual Studio, it should have better support for "dual-development", cause at it is now, code can be overwritten by mistake easily.
View 3 Replies
Dec 2, 2010
After creating a Empty Template based website with a default .cshtml, I am unable to run the web page using webmatrix beta 3. Following error message I have : Server Error in '/' Application. Specified argument was out of the range of valid values. Parameter name: site Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: site Source Error:
[Code]....
Stack Trace:
[Code]....
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
View 1 Replies
Jul 19, 2010
I am new to ASP.NET, I would like to know how to create C# class in seperate file and using it in cshhtml file.
View 5 Replies
Mar 11, 2011
I am building a site with WebMatrix using the razor syntax in .cshtml files. However I'm stumped as to how I can use the normal set of asp.net controls that are found in the toolbox in Visual Studio - eg: calendar, panel, radio button list etc... Is it possible to use these or can you only use Helpers with razor?
View 2 Replies
Nov 21, 2010
Users turn on their computers and XP boots up.I have an ASP.Net website.Is there a way such as a login script that runs that will run the default.aspx inmy ASP.Net website so that the first thing that the user sees after XP boots up is the default.aspx web page in my ASP.Net website?
View 1 Replies
Sep 26, 2010
Im having an issue when I create a new ASP.NET Web Application within Visual Studio 2010, this creates a web.config configured to use SQLEXPRESS. The default web.config that VisualStudio generates for New Web Application Projects still points to the SQLServerExpress Database which I had previously removed! The only instance that I have now is SQL Server 2008 R2 Developer. The web.config that is created along with other files for the for New Web Application Projects template:
[Code]....
The question is how can I change this web.config thats created with the ASP.NET Web Project template automatically from Visual Studio 2010? I can go in and modify the web.config by hand obviously. It doesnt make sense to have the web.config automatically created this way whereby the connectionstrings point to SQLServer Express that does not exist. I did in stall Visual Studio 2010 which included SQLServerExpress, but that I later removed. Now is VisualStudio always going to create web.config's pointing to SQLServer Express?
View 3 Replies
Dec 16, 2010
I'm doing something wrong, but for the life of me can't figure out what. (Maybe it's all the beta software I'm using to build this website ;-) )I'm trying to use the Facebook helpers, which use the WebMatrix.Data and WebMatrix.WebData libraries. These work fine from my class files, but apparently I can't use them in my .cshtml files.Anybody run into this? Alle references to classes in these libraries break my site (not my build btw?). And yes, they are referenced.
View 6 Replies
Nov 11, 2010
I have an ASP.NEt website and I want to know how can determine how long the website was idle (no activity from the user) and then based on that timer I want to automatically logout and redirect to default.aspx?
View 1 Replies
Sep 6, 2010
I have a Asp.Net application eg its name is ABC and I have a server eg whose name is XYZ, where the application is hosted from. The default page for the application is Home.aspx.Now the requirement is I want Home.aspx to open automatically when the server name is typed in the URL. Currently for accessing the Home page I writehttp://XYX/ABC/Home.aspx but I want Home.aspx to open if I writettp://XYZCan anyone suggest how I can achieve this. I have one solution that is making a HTML page as default in IIS and then redirecting it to the respective link.
View 5 Replies
Feb 20, 2013
I have problem with default.aspx setting in global.asax file.When i am running dot net application from solution explorer i can set the default page as start page or when i am running the application the on IIS server i can set that default page as start page through the setting.This thing i want to do in programmatic way using the global.asax file
View 1 Replies
Jan 19, 2011
I am trying to secure very mixed content that is located in an ASP.NET directory. For purposes of this question, it can be ~/MyApp/.
I want all of the content in the directory and its subdirectories restricted to authenticated users. The default.aspx page, though, should be accessible to everyone. This is the web.config in that directory:
[Code]....
Now if you are an unauthenticated user, everything works fine if you request [code]....
The problem occurs in that visitors do not always request "Default.aspx". We have a default document configured so that they get Default.aspx even if they just request "/MyApp". An authenticated user works fine, but an unauthenticated user is directed to the login page.
Now I know that essentially this happens because even though the request for "/MyApp/" will actually end up serving up "/MyApp/Default.aspx", the security system is only checking for "/MyApp/" since that is what I requested. That is then getting the default security for the directory.
How can you configure an exception to allow access when no particular file is requested in the directory??
Is there some dependency between DefaultDocumentModule and UrlAuthorizationModule? In this environment, the UrlAuthorizationModule has been removed and re-added in order to make sure it fires for non-managed requests. I would not expect that to change the order of execution, though, since UrlAuthorizationModule usually goes after DefaultDocument.
A workaround could be to set up the opposite security with the directory being open, and then trying to secure individual files. Because of the (changing) number of files, and extensions, etc, and the fact that you cannot use wildcards in a <location>, this is not really a workable solution for me.
View 1 Replies
Jan 18, 2011
I'm learning to use webmatrix via the tutorials on the website. I've had success with all table operations, when only using one table. I'm using the following address to access the site uredi_let_padalce.cshtml?LetId=4 and the is code:
[Code]....
The page works if I write: where LetId=4 instead of @0. But if I leave the variable I get the following error: The column name cannot be resolved to a table. Specify the table to which the column belongs. [ Name of ambiguous column = LetId ] If I specify the table name LetId_PadalecId. LetId=@0, then I get the parameter missing error. How could I tell the server which LetId I want?
View 2 Replies
Mar 21, 2011
the default ASP.NET Forms Authentication cookie sets it's name as ".ASPXAUTH". Notice the first character is a period? Is there a particular reason for this? Like, does this have an impact on domain names or subdomains for the target domain.
Or is it purely some random thing an MS dev person came up with (maybe to help out the ordering of the cookies, when they were debugging or something .. as text with periods prolly get listed before other strings)?
View 2 Replies
Nov 20, 2010
I have remove default.aspx page from remote server then the site is also running.
View 4 Replies
Jul 2, 2012
How to set the startup page in asp.net, asp.net taking default.aspx as first page but I want to set the index.aspx instead of default.aspx in server ...
View 1 Replies