Link to home
Start Free TrialLog in
Avatar of codeJen
codeJen

asked on

Adding MVC3 module to Orchard

Hello experts.

My issue is adding a MVC3 application to Orchard.  My paths to images, java script files and JQuery scripts do not work unless I put the path to my C: drive where the files are located.  Going across 3 enviroments isn't going to work like this.  

To show an example, here is how the script is currently and not working:
<link type="text/css" href="<%=Url.Content("~/Content/Site.css")%>" rel="stylesheet" /> 

Open in new window


This is the only way it will work that I can find so far.
<link type="text/css" href="C:\mywfg\MyWfg.com2\source\Orchard\src\Orchard.Web\Modules\WFG.OnlineProductGuide\Content\Site.css" rel="stylesheet" /> 

Open in new window


Anyone know why this does not work like this or if there is another syntax I should try? ="<%=Url.Content("~/Content/Site.css")%>"

It works until I add the module to Orchard, then anything referencing another script, page, or CSS file breaks.
Avatar of darjimaulik
darjimaulik
Flag of India image

Can you give us some idea about your MVC3 Application.
What is the Purpose of the application?
What will be added in the CMS.

Orchard is a CMS so there are some different ways to integrate application with a CMS.

I have worked on Orchard so I can help you out in this.
But before that i need some details on your application.
Avatar of codeJen
codeJen

ASKER

Here is a brief description of my application.  It's in MVC3 and it's using a master page.  So far I haven't been able to make the master page work within Orchard.  
Using: MasterPageFile="~/Views/Shared/Site.Master"  Gives an error it can't find it but outside of Orchard this works as it should.

I have tried to add in the Orchard.Web module's web.config this:
<add name="ASPX" path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" requireAccess="Script"/>

Open in new window

 in hope that it would recognize webforms.    Not sure if this is correct since I ran across this in a asp.net forum.  It didn't help my master page to show.

The whole purpose of this app is to display online products.  It should be as easy as moving it in Orchard without changes but not really knowing Orchard there may be things that are not compatible?  Guessing.
Orchard is MVC and it does not support webforms i.e. aspx pages.
so your master page will not work in orchard.

MVC Application can't have the master pages or webforms so i am bit confused that you say mvc app have master pages.

MVC and webforms dont go together.
Avatar of codeJen

ASKER

ASP.NET MVC 3 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of ASP.NET and the .NET Framework.

Orchard is a Web CMS, which essentially aims at helping you build web sites from existing pieces. Orchard is built on ASP.NET MVC.

Is there any documentation that says webforms and orchard don't go together?
ASKER CERTIFIED SOLUTION
Avatar of darjimaulik
darjimaulik
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of codeJen

ASKER

Thanks for your wonderful feedback.
 
Unfortunatly I am faced with webforms not working in our Orchard enviroment.  I have tried the links given already, and the webforms still wouldn't display after making the web.config change.  

However, you did confirm the relative path issue I had so I consider this question answered.
Avatar of codeJen

ASKER

I wanted to add some links here that I really found helpful on top of the great support I received.  Being new to Orchard and Razor view engine has been quite a challenge.  Hopefully this will help anyone else out there new to Orchard and Razor.

I found a video that explains the fundamentals of Orchard and a link that explains the webforms to Razor and also a great explanation of Razor syntax.

Orchard Fundamentals

Intro to using Razor

Razor Pages with Webforms