I have installed Roadkill Wiki engine (2.0.275), but i am facing these problems:-
when i run the project using visual Studio 2012 , i got the following message, on the home page:-
You have no mainpage set
To set a main page, create a page and assign the tag 'homepage' to it.
Also i have noted that the Controller folder is empty, while the View folder do have sub folders. so do i have to create the controller classes manually ?
Thanks
The main page message is from you having no pages created in the Wiki, at least with the "homepage" tag - that's how Roadkill picks out the homepage page.
The structure of the project is slightly, or infact completely different, from the standard MVC template. All C# code including controllers and models can be found in Roadkill.Core. All views, CSS and Javascript (or Typescript) is found in Roadkill.Web.
So to find the controllers and models, have a look in:
Roadkill.Core
- MVC
- Controllers
- Models
Related
I'm starting now with web development in Visual Studio. I have already understood MVC, I have some knowledge of HTML and I started to study the bootstrap.
Then, I discovered the beautiful template Free Bootstrap 3 Admin Template on the web, which has an example online here: https://colorlib.com/polygon/gentelella/index.html
I downloaded the files like custom.css and custom.min.css as they are shown in the following image:
But now I don't know how to put it in my project, so I created a new clean project in Visual Studio Community 2015. I did some tests, and I created some controllers and views.
How can I change the default bootstrap theme that came with ASP.NET MVC project to the downloaded one?
I imagine I should replace the _Layout in the shared folder. But what else should I bring?
I do not want all those example pages, etc. Just Bootstrap and the base layout to create my view's.
I have found everything I needed from a YouTube video, entitled "Plantilla Bootstrap en Proyecto ASP.NET MVC" (obviously in Spanish).
There are many steps:
Adding files to the project
setting the _Layout
set scripts references
bundles
Etc.
Ultimately, it worked.
step one
Create a MVC project Default template in visual studio
Step Two
Delete All cshtml in view folder expect shared folder
you must be detrmine wthich part of your page repeatly in all pages that is your layout and you can put html tag like header menu and footer in /views/shared/_layout.cshtml and write renderbody in part of layout to see default login homepage or etc
finaly
all css and java script folder paste in your project and in layout change target to available js and css resource
Learn about mvc Layout
Understand Css And JavaScript embed from bundle
I've just installed Umbraco 6.1.6 making sure to have this setting in the \Config\umbracoSettings.config file before starting the install process.
<defaultRenderingEngine>Mvc</defaultRenderingEngine>
The site has installed fine, and runs fine, but the site is still full of .aspx and .ascx files. What gives? Shouldn't it have created .cshtml files for views, layouts and Controllers and stuff?
Or have I misunderstood and that is up to the user to put in?
Cheers,
-- Lee
Some part of umbraco will still use UserControls.
Try making a new documentType, that will create a view that matches that doctype
You can overrule the default Controller by creating a Controller with the same name.
Remember to inhert from.
public class NameOfTheDocTypeController : Umbraco.Web.Mvc.SurfaceController
In tutorials and walkthroughs on developing an MVC3 (MVC2) using EF (EntityFramework, Entity Framework 4.1/4.2) I observe quite different orders of adding Model, View, Controller to a project in a Microsoft Visual Studio 2010.
What are cons and pros of different orders of adding M, V and Cs?
and of, for example, adding a model before and, more specifically, after a view and controller?
There is no specific rules for adding one over the other first. When you create an empty ASP.NET MVC3 Project, It will come with some default folder structure which includes one Controller folder, Views folder and Models folder.
Now If you are beginner, This is what i suggest. Add a controller first.
Simply right click ont he Controller folder and Select Add->Controller from the context menu and add your first controller(Give the name as HomeController). It will come with a Default Index action method and you can see a return View statement. Run your project now. It will show you an error saying that it can not find a view. So now it is the time to add a view. Go the index action in home controller. Right click on the Return View() statement and select Add View that will add a view (index.xshtml) under the home folder under Views. Now run the app and you will see the page content.
If you are going to interact with your database, you can add model classes. If you can add POCO class file to your Models folder or you can have it on a different library which is refered to this projcet. It's all up to you.
As Lavinski mentioned, If you create your models first, You can use Scaffolding to create the controller actions for you. But If you are beginner, I would suggest you to create your controllers and views by hand. That will help you to understand MVC configuration works
To start off, I'm using Asp.Net MVC 4, and I've modified my solution to contain the CodeTemplates folder by following this tutorial. (I think my issue might be MVC related?)
I've replaced the code in the Ajax grid template with a with my own JQgrid-template, which was fine for getting my project started. But I'm having trouble creating completely new controller templates (well the having them show up in the create new controller menu)
any ideas?
Update
I've taken a few stabs at using the scaffolding feature, but it's not exactly what i had in mind (although it does work like expected. I watched a video by steve sanderson on the topic that was quite informative), any way to get my custom views/controllers inside the add controller gui?
As far as my understanding of your problem goes, you cannot manage two controllers within one .ps1 file, which corresponds to your "AddController" directory.
You have to use the Package Manager and issue a command like
Scaffold CustomScaffolder <choose-name>
This will generate another subfolder below CodeTemplates with the name . From there, you open and edit t4 files like you did with your existing one.
More info here
I am now testing the new feature of MVC 2 Preview 2 called Areas within one project.
Followed the MSDN article as well as the relase notes document I have created the Areas folder, then area's name folder, then Controllers and Views folders within that.
Of course the route class was added and it works.
Then I have moved one of the controllers and it's view folder to that new area.
And it fails to run aspx page on the first line:
<%# Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
Inherits="System.Web.Mvc.ViewPage<OtherReferencedProjectNamespace.Entity>" %>
with the syntax parser message
"Cannot load the type: OtherReferencedProjectNamespace.Entity" /example entity name here/
Looks like there are no references to namespaces used previously without any problems! Does the code moved into an area have separate namespace references?
No reference changes were made to the project, just moved one of the controllers with it's view files into an area.
I have no explanation for that yet, have you got an idea?
OK - found it! Had to copy Web.config from root Views directory to the area Views folder.