I am working on the css of a website, I would like to know which page is the default page (The one that opens when I run th eapplication). There is no Index or Default. Is there any way to find it from browser or project properties?
Is this ASP.NET WebForms, ASP.NET MVC or ASP.NET Core? If it's MVC or Core, you'll probably find the HTML under a directory named Views and by default the site root home page is atViews\Home\Index.cshtml with the common content inside a file named Views\Shared_Layout.cshtml. – Dai May 10 at 19:10
Related
I'm currently building a feature angular application on top of an asp.net application. I want the angular module to load on all pages but not interfering with the routing of the asp.net application.
I achieve this by using hashlocation strategy but the problem is that some modules are not found when navigating in the application. The bundels are placed in a folder called "plugins"
For instance
localhost:/foo1 - WORKS
localhost:/foo1/foo2 - One module not found (looks in foo2/plugins folder)
localhost:/foo1/foo2/foo3 - Custom themes not found and module not found (looks in foo2/foo3/plugins)
Is there a way to set the deploy url in angular cli to a relative base folder as to look for files in /plugins disregarding the current url?
Is Static files are allowed in your .net app ?
For example in .net core, be default static files allowed and all files from wwwroot folder you can use in ur application.
I have a web site in ASP.NET Core MVC, and I don't want to put my contents inside another folder. I just want to use the old school of creating this file-system architecture at the root of my project's folder:
Styles
Fonts
Scripts
Images
But I can't make ASP.NET Core MVC serving files from them. For example http://domain.test/styles/default.css returns 404.
I've tried to add StaticFileOptions, but I can't get it to work.
Can you help please?
I tried the given solution, that is, to use UseWebRoot("") with empty string to make it refer to the root of my web project. Yet it still returns 404.
I created a Styles folder inside the \bin\Debug\netcoreapp2.0\ and added a Styles.css there and it served the file.
If you are not adding them on the wwwroot folder then you should do more preparation.
This link will help Working with static files in ASP.NET Core
I think before asking you should search some more. For example
this stackoverflow question will help you:
How to Configure an Alternative Folder to wwwroot in ASP.NET Core?
I have a .Net web project. I want to organize my solution explorer and my pages. Because there are 4 type of users and there are many pages. I want to create folders and keep some of the files in them. I've moved the page files into folders but app does not work. So what should i do?
You need to change the Page Title at the very beginning of your web page accordingly. What used to be Inherits="Myproject.MyWebPage" is now Inherits="Myproject.MyFolder.MyWebPage"
Also, aspx files have a Mypage.aspx.designer.cs file underneath and its namespace is namespace Mypage{ but it now should be namespace Myfolder.Mypage{ that's why your code behind has red lines because it can't verify your aspx page via the designer file.
I am working on a sharepoint website which is built upon a Site Definition in visual studio.
All i would like to do is simply add 2 aspx pages to this Site Definition. Kindly reply how can i accomplish this.
Do i add new aspx files under Site Template folder or add a new Feature perhaps? so that when i deploy my solution (.wsp) the two aspx pages appear on the site.
I suggest you create a module feature, add the two .aspx pages to the feature and then add this feature to the site definition.
Maybe also helpful: How to: Provision a File
We liked the approach to have all the pages regarding support - for example - under http://www.company.com/support. After migrating to ASP.NET MVC 3 and trying this we can run every type of page but not inside the same folder.
Is there any workaround for this?
Thanks.
If you need to mix MVC pages and non-MVC pages in the same folder, here's some tips:
Remove the default route "/{controller}/{action}/{id}" and make routes for each MVC page. That way any request that isn't caught by a route falls through to the "old" request handling.
A return View(); method call in a controller looks for a view in a folder named as the controller in the Views folder, so specify the name of the view, e.g. return View("/support/index");.
Note that the MVC views doesn't actually have to be in the folder support, you can put them anywhere you like, it's the routes that determine which URLs are handled by MVC.