VS 2010 - Homepage Won't Load Unless Specifically Type Filename Into Root Of Website
Oct 11, 2012
I'm not sure what I did to cause this but my website homepage won't load unless I specifically type the filename into the root of the website - i.e. URL....works but URL... doesn't. It could be something I changed in the web.config or the project properties.
View 2 Replies
Similar Messages:
Apr 1, 2010
I am doing some work with Web.Routing, using it to have friendly urls and nice Rest like interfaces to a site that is essentially rendered by a single IHttpHandler. There are no webforms, the handler generates all the html/json and writes it as part of process request.
This works well for things like /Sites/Accounting for example, but I can't get it to work for the site root, i.e. '/'.
I have tried registering a route with an empty string, with 'default.aspx' (which is the empty aspx file I keep in my root folder to play nice with cassini and iis). I set RouteExistingFiles to false explicitly, but whatever I do when hitting the root url it still opens default.axpx, which has no code it inherits from, and contains a simple h1 tag to show that I've hit it.
I don't want to change the default file to redirect to a desired route, I just want the equivalent of a 'default' route that is applied when no other routes are found, similar to MVC.
For reference, the previous version of the site didn't use Web.Routing, but had a handler referenced in the web.config that was perfectly capable of intercepting requests for the root or default.aspx.
Specs: ASP.NET 3.5sp1, C#, no webforms, MVC or openrasta. Plain old IHttpHandlers.
View 1 Replies
Jan 27, 2010
I ran into the following issue when trying to run a test website on IIS 7.5 (Windows Server 2008 R2 DatacenterEdition). The web-app is configured to run with framework version 3.5 in a .Net 2.0 app pool. Also the framework 4.0 beta 2 is installed on the server. The application named 'TestPfade' is located under the website's root named 'Default'. It is not only a virtual directory but defined as an application. The folder structure looks like this: The markup of the sole document reads as follows:
[Code]....
When viewed in a browser the image gets shown because the given relative path is correctly resolved to 'images/Lighthouse.jpg' but the paths to the ajax-framework resources also include the application's root folder and therefor aren't found: 'src="/TestPfade/WebResource.axd?d=1bX...' Here is the complete html-source generated:
[Code]....
View 9 Replies
May 22, 2010
I am developing a C# VS 2008 / SQL Server 2008 website. Although this same code compiles in the Project version, the website version does not compile. Many of their files are the same so I do not understand even where to look. The only compile error I get is:
Could not load type 'DataMatch'
in my DataMatch.aspx file. Is the problem in my web.config file? How do websites differ from projects in VS? All four of these files reside in same directory.
Default.aspx file:
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="AddFileToSQL" Title="Untitled Page" %>
Default.aspx.cs file:
using System.Data.SqlClient;
using System.Security.Principal;
namespace AddFileToSQL
{
public partial class AddFileToSQL : System.Web.UI.Page
{
...
DataMatch.aspx file:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataMatch.aspx.cs"
Inherits="DataMatch" %>
DataMatch.aspx.cs file:
using System.Web.UI.WebControls;
using AddFileToSQL;
public partial class DataMatch : AddFileToSQL
{
View 1 Replies
Feb 25, 2010
We are starting to add some MVC pages to our exsiting WebForms website. When people type in[URL] they get a 404. If they type in[URL] then it works.
We are running Windows Server 2008 R2 with IIS 7.5. The default document is set in IIS.
The 404s started when we introduced MVC, so routing must be the guilty party here.
Here is my Global.aspx.cs.RegisterRoutes method
[code]....
View 6 Replies
May 26, 2010
I've a poll website with few tables :
poll
poll_question (id_poll, question, type_question ...)
poll_answer (id_poll_ans, id_poll, ans1...default)
type_question (id_type, type) type is dateValue, dropdownlist, checkbox or value)
If question have several answer like (yes, no.... or value in a dropdownlist then i will have to get this value from poll_answer)
So my question is ... how can i do to introduc this datas and dynamicly load the good kind of control, (dropdown or textBox or checkbox...)
View 9 Replies
Dec 21, 2010
So I created a website in visual studio 2010 and I transfer it to my web host.
The problem is the webhost has the a file structure like this:
[URL]
And I put all my files in wwwroot, and it works fine on the web.
But now in VS, since I had to add [URL] folders, I am getting compile errors that say "This error can be caused by a virtual directory not being configured as an application in IIS".
So my question is - how do I either A) change the root application for IIS on my machine to be at the wwwroot levelB) change VS to let me copy files from the root directory in VS to the [URL] dirctory.
View 8 Replies
Jun 15, 2010
Following error comes when creating a WebPart In sharePoint 2010 Server.
Web Part Error: Unhandled exception was thrown by the user code wrapper's Execute method in the partial trust app domain: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.TypeLoadException: Could not load type 'Microsoft.SharePoint.WebControls.SPGridView' from assembly 'Microsoft.SharePoint, Version=14.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. at ListMenuSample.ListMenuSample.ListMenuSample.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.ExecuteHttpRequest(SPUserCodeWebPartHttpRequestContext webPartExecutionContext, SPUserCodeWebPartHttpResponse httpRequestResponse) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.Execute(SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)
View 1 Replies
May 17, 2012
I am using url rewriting rules in my web.config and have it working but today I added a rule in a folder but my primary rule keeps overriding.
Web.config
Code:
<rewriter>
<rewrite url="~/folder/*_a_(.+).aspx" to="~/folder/index.aspx?id=$1" />
<rewrite url="~/*_a_(.+).aspx" to="~/listing.aspx?id=$1"/>
</rewriter>
Usage:
www.domain.com/topic_a_1.aspx -> This would load listing.aspx?id=1 which is great.
www.domain.com/folder/newtopc_a_2.aspx -> This is also loading listing.aspx?id=2 but should be loading index.aspx?id=2
I believe I need to change the second rule from *_a_... to something like [^/]_a_.... but that doesn't work.
What I can do so the second rule doesn't override my sub folder rules?
View 2 Replies
Jan 19, 2011
I am URL routing myself.
Main project only contain the URL routing code.
Different websites are placed on approot.
e.g: I have deployed VS2010 test-default-website at approot/webTest/.
I am trying to opening [URL] from browser.
For that URL request, I am serving page using PageParser.GetCompiledPageInstance(), as follows:
In URL route request handler,
return PageParser.GetCompiledPageInstance("webTest/Account/Login.aspx", HttpContext.Current.Server.MapPath("webTest/Account/Login.aspx"),
HttpContext.Current);
I am getting following exception:
The file '/Account/webTest/Account/Login.aspx' does not exist.
PageParser.GetCompiledPageInstance is automatically appending '/Account' before the actual address, thus unable to find it.
How can I make it not to append '/Account' ?
View 1 Replies
Jan 9, 2010
I have an ASP.net Website. the project' content is in a folder called MyWebSite. When I run my application from Visual Web developer 2008, the browser displays the following address in the address bar: http: // localhost/ MyWebSite /Default.aspx
I want to be able to run my Website from the following address:
http://localhost/
View 3 Replies
Mar 8, 2011
IIS 6
ASP.NET 3.5 (C#.NET)
We are having an issue where the same set of files behave differently depending on if it is a root IIS website versus an application under an IIS website. The urls produced using ResolveUrl() are different - i.e.:
<a href="<%=ResolveUrl("~/contact.aspx") %>">Contact Us</a>
As the root website, it produces: http://contact.aspx
As an application under a website, it produces: http://domainname.org/DSC/contact.aspx
Both are utilizing the same files. The first example is its own website, the second is a virtual directory made into an application (titled DSC). Both also use the same application pool, and same configuration, document and security settings (I made sure all the settings were the same in IIS between both).
Everything that has been researched indicates ResolveUrl() does refer to the IIS application that the webpage is under. I have also read several places that even if the information isnt completed in IIS (in this case it is), a root website is considered an application. Therefore, it should produce the appropriate web address, but isnt.
View 1 Replies
Jul 9, 2010
I've followed this link [URL] to configure my application on iis7.
- I've published it
- create a folder in inetpubwwwrootMyApp
- I've created my virtual directory to point on MyApp
but then to log on it, I need to point on http:\localhostMyApp but i would like to point on http:\localhost
View 1 Replies
Jul 29, 2010
I am trying to select all the files from a folder in my website and store them in a collection. The problem is that when I run the website it is not selecting the folder in my website:
This is the basic structure: [Root Folder] --> [FilesFolder]
Here is the code I am using:
DirectoryInfo dir = new DirectoryInfo("FilesFolder");
But it is showing this at runtime as the location of the folder:
C:Program Files (x86)Common FilesMicrosoft SharedDevServer10.0FileUploads
Is there a way to select the folder relative to the root of the website?
I am using C# with ASP.NET 3.5
View 2 Replies
Jan 3, 2010
I want to find the root path of my asp.net website.
Im using Request.PhysicalApplicationPath right now which looks like this:
F:CasperMy DropboxDotNetPortfolioV2 (Which is good)
But if I go to a folder it will be:
F:CasperMy DropboxDotNetPortfolioV2FolderName (Not good)
I just want the root.
View 2 Replies
Jul 16, 2010
I have an ASP.NET application running on Apache server with mod_mono. If I have a folder called "temp" located in the website's root directory and run the following code
System.IO.TextWriter tw = new System.IO.StreamWriter("temp/test.txt");
tw.WriteLine(DateTime.Now);
tw.Close();
it saves test.txt in C:Program FilesMono-2.6.4in emp on the server. If I add a slash to the directory name like this: System.IO.TextWriter tw = new System.IO.StreamWriter("/temp/test.txt"); It saves it to C:/temp. Both do not do what I want. How do I get the code to save the file to the temp folder inside my website's root directory? Is this a mod_mono issue or something to do with Apache? I have tried adding this line to httpd.conf Alias /temp "C:/Path_to_root_folder/temp" without any luck. I shouldn't have to use alias if the temp folder is within the root directory, correct? In my development environment which uses XSP as the web server everything works as expected. It is only a problem when running on Apache.
View 1 Replies
Oct 30, 2010
I have a flash banner in my website and it has some navigation links on it. Because I have several different folders in my website I need address them from the root. At the moment i use getUrl like this: getURL("ArticleList/Default.aspx"); But it doesn't work .
View 2 Replies
Jun 9, 2010
folders in my website root are
a
b
c
I have subdomain "s1" which points to "a" folder. I want to know how could I access to files stored in "b" folder form subdomain "s1". My issue is that files I have some html content which saved in DB Records and their path are base on webroot i.e. "<img src="/b/movie1.avi" /> .Could any one tell me how I could show these files via subdomain "s1"
View 1 Replies
May 27, 2010
i have a website project. i have 2 folders within default.aspx. in the root i have no default.aspx.
How can i redirect users when they are in Role "Folder1" to the ../Folder1/default.aspx
and user in Role "Folder2" to the .../Folder2/default.aspx
View 2 Replies
Sep 16, 2010
Is it possible to control the behaviour of ASP.NET when the Session has expired? It seems that the default behaviour is sending the user to the website root. The desired effect would be to send the user to a custom "Session Expired" page.To clarify, it's the SessionState that's expiring (set the timeout to 1 minute to quickly test it):
<sessionState mode="InProc" timeout="1"></sessionState>
The authentication cookie timeout is way higher, to avoid any mix-up:
<authentication mode="Forms">
<forms loginUrl="SessionExpired.aspx" slidingExpiration="true" name=".ttpASPXAUTH" timeout="58" protection="All"></forms>
</authentication>
View 2 Replies
Dec 27, 2011
I had a look at Displaying images that are stored outside the Website Root Folder
View 1 Replies
May 27, 2010
In Visual Studio I added a text file Example.txt to the root folder of my web site (where Default.aspx exists).
Later in C# code I reference this file :
string text = File.ReadAllText("~/Example.txt"); // also tried without the ~/
During runtime, both debug and non-debug, I get an error at this line of code:
C:Program Files (x86)Common FilesMicrosoft SharedDevServer10.0Example.txt'.
So, how should I reference this file?
View 2 Replies
May 7, 2015
I want to display images from outside the domain url. How to achieve this.For Example my domain is www.test.co.in
My folder structure is
--Documents/Images (that has images)
---test(root folder that has project files)
View 1 Replies
Feb 11, 2011
I am using iis 5.1 in which we have only only one default website, I have two projects v2 and v3 my website points to v2 projects and have some folders images, styles etc now i have a virtual directory under this website that is hosting project v3 and having the same folder hierarchy as v2 in the home page of the both projects i have img src="imagesedlogo.gif" alt="logo"/> but this shows the same image that is in the v2 directory, How can i show different images for both projects. using "" get the root of the web site but how can i get the root of virtual directory under that website
View 2 Replies
Sep 17, 2010
How can you request the root default.aspx without specifying it in the url for your root application?e.g. ttp://localhost/MyApp/ instead of http://localhost/MyApp/Default.aspxshould be able to do bothI'm not sure if this is a setting in IIS 7.5 for the application or what.
View 3 Replies