Convert Composite C1 - insert MVC partial requires Visual Studio solution? - c1-cms

It appears that you either start a Composite C1 site by using the Visual Studio solution - or just install the exe, which contains no solution file and can just be used through the web CMS.
I need to include an MVC 4 Partial in a page on a site that was only installed with the .exe & edited only through the web CMS. Can I add a partial in the CMS (not in VS), or do I have to use VS & manually compile the site before deployment?
I have tried adding the sample MVC files from the below to my C1 site & navigating to /Home:
http://docs.composite.net/Functions/MVC/HelloWorldMVC
The URL for Composite is localhost/mysite
I try going to localhost/mysite/home - but it doesn't work.
Thanks.

do I have to use VS & manually compile the site before deployment?
Normally, you don't need Visual Studio in order to use the MVC Player - unless you have to use VS (or any other tool) to create and add views and controllers to the website. In any case, everything should work on-the-fly without having to compile the website

Related

Visual studio 2019 and IdentityServer project template

Trying to follow the tutorials for IdentityServer using Visual studio 2019.
As per the instructions created a .Net Core Web Application and then an MVC project type and as per tutorials a welcome screen for IdentityServer should come at run time
But i am getting an MVC page template only like this
Is there any difference in project templates based on new visual studio updates? Or what is the correct selection of project types to get the window similar to the first image ?
It seems you are running the mvc application insteed of the identity provider service.
Go to the solution properties, Common Properties, and select Multiple startup projects. Then change the Action to Start for debug all your projects.
If you prefer start only your identity provider service set it as the Single startup project.

Is it possible to build a SPA without using .net framework in visual studio?

The title should be self-explanitory, but just in case. I am trying to build an angular application which will be hosted on azure. Currently I am having some issues with using kestrel, so I would like to build the application in visual studio but without using any .net code (so no startup.cs or program.cs).
If the answer is plainly no, then I guess I will need to find another IDE that will do what I require.
Yep. Just create a website project instead of a web application project.
https://msdn.microsoft.com/en-us/library/dd547590.aspx
Scenarios in which Web site projects are the preferred choice include the following:
You do not want to have to explicitly compile the project in order to deploy it.
Yes it is very much possible with visual studio to develop a SPA in angular without using .net framework. Below are the steps you can follow to getting started with a SPA in angular using visual studio.
Goto: File > New > Project
From the below screen selecet ASP.NET Web Application
Provide Name, Location, Solution click OK will get the below popup
From the above Popup select Empty and Press OK to create your project.
Now add an html file say index.html to the project. Write the below code in index.html
<head>
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js"></script>
</head>
<body>
<div ng-app>
Message:<input type="text" ng-model="message" />
<hr>
<div>Entered Message:{{message}}</div>
</div>
</body>
</html>
And you are good to go. Right click on index.html and select View In Browser you will see the output in your browser something like this.
Now You can can create a directory structure accordingly. Below are few link that can help you with the directory structure.
Directory Structure Angular
Angular Folder Structure
Angular App Structure Guideliines
Or you can follow the steps as stated on official Angular website for getting started with an angular project in Visual Studio
VISUAL STUDIO 2015 QUICKSTART ANGULAR
Hope this Helps :)
Yes you can develop a SPA application without .net code in visual studio. Visual studio code is another IDE for cross platform development.
Check out the example at pluralsight
My Assumption here: You are ok to work on your website offline without actually firing it off thru the Azure hosted location.
I will try to address how to have a website opened up in Visual Studio which has nothing to do with project based on .NET Framework.
Steps to follow:
a. Create a physical folder on your drive and keep your SPA related files in it or let's say keep a simple "HelloWorld.html" file which just display some plain text.
b. Go to VS > File > Open > Website (Four or more options will be present)
- choose the simplest "File System" and point to the folder created in step a.
VS will open the folder as website and add a solution file to it but no other .NET Code is associated to it. This way you can use the IDE as I think you intend to use.
If you using node toolings to build you project you may want to try Node.js Tools for Visual Studio
It does have support for gulp/grunt tasks as well as it has integration with azure. The support is provided via custom project types.

Templateless Module Development

Throughout the internet documentation for DotNetNuke is far and wide, this in itself is quite useful. However one hurdle exist and I can't appear to solve it. How do you do DotNetNuke Module development without Chris Hammond's Template?
This template has become so widely accepted and utilizes that no other documentation exists.
I've already accomplished the following:
Configured SQL Server Database
Configured Internet Information System (Bindings)
Modified the System32 Host File (For local IP to reflect web-site Name)
Installed the MSBuild Community Task
Installed DotNetNuke Instance
Everything is installed and in place, now I have open DotNetNuke's Site into Visual Studio and configure my project to actually build the module.
I figured if I reference the .dll for DotNetNuke that should suffice, but the Web Forms Project loads all this extra garbage that impacts the development.
Could someone outline the proper way to build your environment from scratch without the template for Visual Studio?
Setup a DNN Development environment, even if you aren't using my templates I recommend the same dev environment approach http://www.christoc.com/Tutorials/All-Tutorials/aid/1
Using Visual Studio create a new Web Application Project, with a location of /desktopmodules/ in your DNN dev environment. (Follow Step 9 of this tutorial http://www.christoc.com/Tutorials/All-Tutorials/aid/4)
Remove everything that Visual Studio puts into the WAP project (folders, web.config, etc).
Add an assembly reference to DotNetNuke.dll in the website's BIN folder
Right click on the Project properties and set properties on the project to have the Build location be the website's BIN folder (../../bin)
Change the web tab have the following properties set
IISUrl:http://dnndev.me/desktopmodules/MODULENAME
OverrideIISAppRootUrl:True
IIS App Root URL:http://dnndev.me
Add an ASCX file to your project. (view.ascx)
Change the BASE class for the ASCX file to inherit from PortalModuleBase
Compile your module
Register the module with DNN (host/extensions)
Add the Module to a page.
TL;DR
Save yourself the trouble of steps 2-8 and 10 by using the template.
Honestly, the best bet if you want is use Chris's template as a base, and edit it to get it as plain as you want it to be.
I have a plain template that only has the MSBuild configuration in it as I don't even have local copies of DNN on any of my development machines.
The key magic pieces of his template is the MSBuild stuff, and I go one step further and use NuGet to manage the packages/references to DNN that way I don't have any other DNN files locally.
This is what I used to do BEFORE I started using a template. Very similar to #bdukes but rather than developing in the DesktopModules folder, I like to keep my modules in their own projects outside DNN.
In Visual Studio, select File -> New -> Project.
Select '.NET Framework 4' from the version dropdown and C# -> Web from the tree pane on the left then 'ASP.NET Empty Web Application'.
Delete the web.config file.
Add a reference to the DotNetNuke dll.
Add a new user control to the project, this will be your main view for your project.
Make sure the user control inherits from DotNetNuke.Entities.Modules.PortalModuleBase instead of System.Web.UI.UserControl.
Build the project in Visual Studio.
Right click on the Project in Visual Studio and select 'Open Folder in File Explorer'.
Copy the DLL of your project into the bin folder of your dotnetnuke instance.
Paste the project folder in your DotNetNuke instances DesktopModules folder.
Delete all files except the user control you created from the folder you pasted under DesktopModules.
Login into your DNN instance.
Navigate to Host -> Extensions -> Create New Module.
Select 'Control' from the dropdown.
Select the module folder (not owner folder) you pasted in DesktopModules.
Give your module a name and tick the option 'Add Test Page'.
Click 'Create Module'.
You will then be taken to a test page with your new module running with only an empty user control. You can then add controls into the modules folder, rebuild and copy the new DLL into DNN's bin folder and you'll see the changes in DNN.
I would then go back to Host -> Extensions and click edit (the pencil) next to the newly created module. At the bottom of the page there is a 'Create Package' button. Follow the prompts until you're at the preview manifest file. Copy this as your modules manifest file and add it to your project.
Don't forget to add any new views, edits, settings controls to the module definitions and re-create the manifest. (Host -> Extensions and click edit (the pencil) next to the module -> Module Definitions heading)

Adding an AngularJS project to a Visual Studio 2012 solution

I would like to create a Visual Studio 2012 (Premium) solution, initially containing a project for an AngularJS client. Later on, at least one ASP.NET MVC 4 project will be added defining the server the AngularJS client talks to. We would like to keep these things in one solution.
The problem is that I cannot find a fitting project template (installed or online) or a way to manually define such a project. No matter which project template I choose there is always too much cruft being added, as all project templates are based on some programming language / environment irrelevant to the AngularJS project. I would be happy with a blank project template to which only the relevant html, js, css,... files would be added.
One could of course define the ASP.NET MVC 4 project and then add the client parts to some folders in that project, we had already done such things in the past, but things get very cluttered.
Do you know how to naturally define such a web client project in VS 2012 or if VS 2013 does handle this better?
We came up with the following solution: In Visual Studio, select "Add New Web Site" -> "ASP.NET Empty Web Site". This approach fits the bill since it does not add much to our AngularJS project and hosting the application is also taken care of.
I would suggest create a new ASP.NET Web API project. File - > New Project-> ASP.NET MVC4 Web Application . In the next screen, select "Web API". Since you are doing the client only using HTML,CSS and JS , your server side becomes a bunch of APIs for which you need to create a Web API project only and not a full MVC 4 app. Even Web API project also comes with some MVC4 files and folders, which you can remove easily.

CustomerManager angularjs by DanWahlin

I m trying to learn Angular.js framework, getting examples on internet "CustomerManager angularjs by DanWahlin" demo seemed comprehensive and downloaded the code from Github "https://github.com/DanWahlin/CustomerManager" .
But when I try to open the index.html, it doesn't show anything. am I doing some mistake??
other examples that I downloaded like TODO using angular work fine.
Also if anyone can share some real time examples as to how the code is generally organized in PROD then it will be very helpful.
Thanks.
It is because the files are not supposed to be opened in a browser directly from the file-system.
(Many src, href etc attributes break.)
You have to follow the instructions on the Readme.md file. E.g. on Windows:
The following is required to support the backend services:
Visual Studio 2012 Web Express (free version) or higher - http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products#product-express-summary
ASP.NET MVC and Web API are used for the back-end services along with Entity Framework for database access (included if you have VS 2012 express installed)
To get started, double-click the CustomerManager.sln file located at the root of the CustomerManager repository. Once the solution loads press F5 to run the project.

Resources