Adding 2 simple aspx pages to Sharepoint Site Definition - asp.net

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

Related

How to find the default page name

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

.Net Changing page locations in Visual Studio Solution Exp

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.

Create pages in published code

I want to know whether we can add new pages in depolyed MVC project code?
Based on my experience, it is not possible.
Please share your thoughts.
P.S: I need to add two new pages in published MVC code. So there is no chance to write any additional code in controller and model part.
Yes, you can add .cshtml to your publish folder in view, but you cann't add server side code in publish dll

Add asp Code to DNN Page?

I am very new to DotNetNuke. I did some development separately in Visual Studio. I just want to copy over the grid view code that I created onto an existing DNN page. When I used WordPress I simply got a PHP plug-in so that it could read the code when I added it to a page.
check out these templates to get you started building modules:
https://christoctemplate.codeplex.com/

What must I do with a solution file showing under my web site?

I have just been handed an ASP.NET web site project, without a parent solution. I created a new solution, and added the web site project under the solution, as I am always more comfortable grouping all my work under a solution, even project-less web sites. Now, when I open the solution, then expand the web site folder, I see the solution file appears under the web site folder, yet I have checked and it isn't duplicated here. How do I get rid of the solution file item under the web site?
OUTCOME: It turns out that I somehow confused folders and had both my solution and web site under the same folder, and as Chris Lively says below, all files under a web site appear in solution explorer.
If you really want a solution, create the solution file one directory up from where the website is.
Website projects are going to automatically include every file it finds along the site path. If your solution file is in the same directory, then it is going to be added.
My recommendation is to move the solution file, then convert it to a web application project.
Use a text editor to remove the nested projects entry and corresponding project entry like this ("Tests" here is a solution folder) from the .sln file:
ASP.net web sites do not require solutions. Just open the code in visual studio as a web site.
The perception that they require a solution comes from the old days. No longer the case.
I assume this is not MVC. Because MVC does require a project.

Resources