create custom modules in source code ,build in release mode and use it in project with release files

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/13/2009 8:21:25 AM
Gravatar
Total Posts 98

create custom modules in source code ,build in release mode and use it in project with release files

I add in source code a new folder for MycustomModules and create a CartUserControl.ascx and CartsiteModule.ascx(like it is propose in heloo word example from mojoportal documentation).

I want to separate code by the tags and put the all c# code in code behind.I do this and click on build in release mode.

But give me errors: The labels (i have two labels on acsx) is not recognized in ascx.cs file.

The same things i do for release files project and work ok.But here I have <script runat="server"> tag where put the code in ascx.

Maibe is problem with this:<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CartUserControl.ascx.cs" Inherits="MyCustomModules_CartUserControl" %> ?

In release files i have :<%@ Control Language="C#" AutoEventWireup="true" ClassName="CartModule.ascx" Inherits="System.Web.UI.UserControl" %>

Regards,

Valik

4/13/2009 8:27:10 AM
Gravatar
Total Posts 18439

Re: create custom modules in source code ,build in release mode and use it in project with release f

If you want to use Codebehind and compile the C# into a dll then you should create a new "Web Application Project" in your solution. Set project references from this project to any of the mojoPortal projects you may need like mojoPortal.Business, mojoPortal.Web, etc.

Then use post build events to copy your .ascx file(s) up to the Web/yourcustomfolder and copy the dll to the Web/bin folder

You can see example post build events in mojoPortal.Features.UI or in WebStore.UI, right click the project and go to properties.

If you want to use controls from mojoPortal.Web in your project you need to declare them in the Web.config file of your custom project in the <pages><controls section

You can see examples again in the projects mentioned.

Hope it helps,

Joe

4/13/2009 8:45:31 AM
Gravatar
Total Posts 98

Re: create custom modules in source code ,build in release mode and use it in project with release files

 For example if in my project i want to Change Search Result.aspx.cs page i must add reference for what project?

Or I must just copy the mojoPortal.Web structure?

Thanks,

4/13/2009 9:11:18 AM
Gravatar
Total Posts 18439

Re: create custom modules in source code ,build in release mode and use it in project with release f

You will need references to mojoPortal.Web and other projects, mojoPortal.Business, mojoPortal.Business.WebHelpers

You should not change the SearchResults.aspx.cs in mojoPortal, if you change things in mojoPortal you will not be able to get upgrades without losing your changes.

You could create a new SearchResults page in your own project and then use post build to copy it up to Web folder replacing the one there. That way your custom code is always in your own projects so you will never lose it. Use your own namespace and class names in your custom version. First copy the code from mojoPortal existing version and get it working from your project using your post build event to replace the existing one in Web. Then you can start customising your version. Whenever you make a change whether in your .aspx file or in your .aspx.cs file you have to build again so the post build will copy the files again up to Web so you can see your changes.

If you have any trouble about the master page reference just create an App_MasterPages fodler in your project then add a new master page there named layout.Master

Hope it helps,

Joe

4/13/2009 9:40:33 AM
Gravatar
Total Posts 98

Re: create custom modules in source code ,build in release mode and use it in project with release files

Before this moment I use only release files and all new functionality(like save in database some information ) i write in code inline

I use mojo interface for add html contents and another text. 

You thing that i will have problem in the future?

I don't need upgrade to new version!

Regards, Valik

4/13/2009 12:47:25 PM
Gravatar
Total Posts 18439

Re: create custom modules in source code ,build in release mode and use it in project with release f

You are of course free to do as you wish.

If you are developing against the pre-compiled release, then you will be able to upgrade because you are not modifying any of the C# source code because it is pre-compiled in the dlls. But still if you modify the .aspx or .ascx files you can lose your customization if you upgrade, or your custom copy may no longer work if the original version has changed internally.

I generally recommend developers to work with source code. The biggest benefit is there are examples of code to do almost anything you would typically want to do. If you want to do anything that is similar to any existing functionality you can review the code and learn how to do it. And you can find lots of little undocumented helper methods that make things easier.

Its always possible that bugs will be found and you will want t be able to upgrade to get bug fixes.

Also mojoPortal is constantly improving and getting new features and functionality. I think its a bad assumption that you will never need or want to upgrade. Never is a long time. 

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.