is it possible to separate my admin section from regular web site without creating another web app project? - asp.net-mvc

I built my web application using asp.net mvc3. I need to add admin pages to monitor and manage all user accounts and their posts.
Right now, admin and regular web site are sitting in the same web application. if I only made a small change for the admin pages, i still need to compile everything. is it a way separate them, so I only need to upload admin without touching the web site. the only solution I can think of is to create another web app. is there another way to do it?

You can separate your mvc application into Areas
http://msdn.microsoft.com/en-us/library/ee671793.aspx
Areas help you better organize your application it won't let deploy just that area, but VS2010 does have some good deployment features. Her's a good article
http://weblogs.asp.net/scottgu/archive/2010/07/29/vs-2010-web-deployment.aspx

Related

Sharepoint Online Development

I am a developer with .net.mvc, angular background. We have some application developed in mvc, angular.
My question is
1. Recently my company want to do the development on share point online(not on premise). I want to develop an app either in angular\MVC which can be deployed and accessed from share point. The app basically calls one of our on premise database displays in a grid. It also involves some crud operation.
Can anyone suggest any ideas for this.
Tried reading through some sites but doesn't helped.
Create SharePoint provider hosted add-in so you could use MVC project web template(a .net MVC project), so you could develop based on your existing .net knowledge.
get started
You could host provider-hosted add-in(MVC web) in azure.
https://www.dmcinfo.com/latest-thinking/blog/id/9543/how-to-create-a-sharepoint-online-provider-hosted-app
Hey Sorry Your question is getting attacked but I believe I have an approach for you.
Normally youd be able to just create a server side webpart but since you are online you wont be able to use MVC and will need to leverage front end solutions or the SPFx Framework.
If you want to go a more pure javascript route you can create an Angular Application like SPJEFF has done. He has built an Angular App that leverages the SharePoint API and runs inside a content and media webpart that you can embed into the page. Please see his blog post for more info. https://www.spjeff.com/2018/12/25/video-angular-2-cli-todo-list/
Your next option is the SPFx route. Its pretty mature for the online community and constantly updated. Heres a quick read on why you should use it. https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview
Please message if you have any questions.

Authenticatnig ASP.NET MVC application against Sitecore users

I just started to working in Sitecore. I am developing a web application in ASP.NET MVC 5.0 to create / edit some content in Sitecore. I am looking for the best way for authentication in web application (MVC) using existing Sitecore users. User management part will stay with Sitecore, just need authentication (login) in web application against Sitecore users. Can I use Identity concept of ASP.NET for the same?
Sitecore use Membership providers.
Normally create for web users a new domain. so not the same as CMS users.
See This:
http://fes-sitecore.blogspot.nl/2015/02/using-membership-with-sitecore.html
And the Documentation from Sitecore:
https://sdn.sitecore.net/upload/sitecore6/sc61keywords/membership_providers_a4.pdf
I have done this in the last few weeks.
What you will need first to to create a Role in Sitecore that your Extranet (siteusers) will get logged in against. Create a user and assign them to this role.
You will need to go to the security editor (i think) and select the 'everyone' role. Allow everything and inheritance from the top of the tree. (green cross on the content item)
For the item you wish to lock put a red cross against the inheritance
Then select your created role and put a green cross in inheritance against the item you wish to allow this role to see
From Sitecore: The idea is allow everything for everyone and break inheritance to secure it by adding a red cross to inheritance.
From the website: The idea is that everyone (siteusers) don't have access to the page and will get redirected. People in your new role will go to the page.
Next take a look at the post above but in your site settings you need a configure the location of your login page.
After these steps you should be able to navigate to the page and get redirected to your login page (Make sure you are not in the content editor)(incog mode google chrome)
So finally you can use the Sitecore.Authentication namespace and there are method on there to authenticate and check if a user is in a role ect.
Take a look at https://sdn.sitecore.net/upload/sitecore6/sc61keywords/security_api_cookbook_usletter.pdf
Hope this helps. Any questions just ask. Its hard to explain in text :)
Aki,
You can leverage the sitecore authentication which is very useful, I am using this in my all projects since sitecore 6.5 to 7.5.
you just have to explore few APIs of sitecore membership, there you will get
How to create roles
how to set users in roles.
And how to provide proper security or limited access to a particular role.
How to set custom data for users also.
Make sure you are not using sitecore domain for web users, use extranet domain. Sitecore domain is only for user who are supposed to login into sitecore dashboard.
Hope this will help you..
Cheers!!

Creating MVC Application That Can Easily Integrate Into Existing Applications

I have created a custom MVC Forum application. But I'm starting to think that although it works great as is, I'm going to need to get it to work within other MVC apps (In fact I have actually been asked that already).
What is the best way with an MVC app to structure/develop to make it as easy as possible to integrate into an existing MVC application?
Areas? Develop within a sub folder from the start? Or is it just you have to work through and merge configs/controller clashes if necessary.
No need to Config or ... . you only need to create ability in your Logon Model and it's Controllers. A complete example is in Asp.net MVC 4 which Microsoft has added more libraries for authenticate from other sites/profiles. Also the model has changed a few in properties. see this technology or download MVC 4 framework to learn it. it's easy.

Can I set up Orchard CMS to be a sub directory of my "real" web site?

I have a web site and I would like to add some CMS capabilities to it (blog, forum, comments, rss, etc...).
Ideally, I'd like to co-host my existing asp.net MVC web site with a CMS like Orchard which should be under mysite.com/cms or mysite.com/blog.
How could I set that up ?
Alternatively I suppose one could set up a sub domain such as cms.mysite.com but I'm wary of deployment complications and SEO implications. Any feedback on such scenarios ?
I suppose I could also do the other way around and have my real web site a sub directory, and have the CMS be at the root of the site. I just need to marry the two together.
I'd like to avoid URL rewriting if possible as suggested at How to add an ASP.NET MVC sub-application under Orchard CMS in IIS7? as it can have its own complications (e.g. the application is not aware of its real url).
Thanks
Orchard is not designed to add capabilities to an existing site. It needs to run in its own IIS application.

ASP.NET cms and display template - 2 projects or just 1?

This is a ASP.NET MVC beginner question (I'm in phase of developing NerdDinner)... I have assignment to create ASP.NET MVC cms (with its own design) and portal (also with its own design) that will display data that's being handled by CMS. I was wondering if I will have to make two individual projects in Visual Studio or I will have to use one project and place portal section in specific folder.
I know that my question is a bit premature (according to fact that I still haven't finished tutorial) but I'm bit impatient :)
On server (commercial hosting) I would use only one hosting account... this thing with URL routing is a bit confusing to me, CMS is practically also optimized for SEO.
I would like to the structure of URL to be:
---- PORTAL ----
www.domain.com
www.domain.com/Menu1/Submenu1
www.domain.com/Menu2/Submenu1/SubSubmenu1...
etc.
---- CMS ----
www.domain.com/CMS
www.domain.com/CMS/Whatever
Thanks,
Ile
It all depends on the functionality of the portal and the MVC cms.
For starters I would have a separate solution for the Model/Data Access that way you can have as many MVC projects without duplicating your data access.
From your desired url structure I would probably have the CMS as a separate controller and sub folder. Alternatively if your using MVC 2 you could look at the areas support which will probably give you a little more flexibility.
If you want the solution to be a bit more complex/flexible you have a number of options:
If both the portal and MVC cms are going to have he same functionality and page layout you have two master pages and determine which mater page to show when returning the view. You would specify this in the routing so multiple routes would point to different controllers.
If the layout/functionality differs slightly but one controller can still manage both you could have a separate controller project and two mvc projects which only contains the views, javascript and images so both mvc solutions look at your controller solution. With this option you would probable end up setting up two websites on your domain one under the root and the other under the CMS folder (in your MVC app you will prob need to block routes to /CMS so it will be processed by your CMS app).
Finally if both differ hugely have two separate projects but keep your common data access project, as above you may need to set up two sites on your hosting package.

Resources