VB.NET

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
3/3/2009 4:46:49 AM
Gravatar
Total Posts 29

VB.NET

Can I use VB.NET to develop modules to use in mojoPortal? or do I have to develop in C#?

3/4/2009 5:15:21 AM
Gravatar
Total Posts 55

Re: VB.NET

If you follow guidelines for custom development here, you should be able to develop modules in any .NET language, be it VB, IronPython or whatever.

You could also develop your own modules inside current mojoPortal.Web project but I wouldn't recommend it, especially if you use language other than C#. In that case, you wil most probably end up with requirement that you must add special tags in web.config to ensure proper compilation, tags like <add directoryName="YourModule_BLL_Or_DAL_Folder">, which is quite annoying from the viewpoint of fast deployment.

3/5/2009 5:43:38 AM
Gravatar
Total Posts 18439

Re: VB.NET

Yes, you can. You can either add your own VB.NET projects to the solution and use post build events to copy files up to the main web project (as we do in the mojoPortal.Features.UI project) or you can use inline code and just drop in files.

For example here is a simple hello world in VB.NET, you can create a text file VBTeast.aspx and paste in this code, then drop the file in your mojo site and it will work.

 <%@ Page Language="VB" ClassName="VBTest.aspx" Inherits="System.Web.UI.Page" %>
<%@ Import Namespace="mojoPortal.Business" %>
<%@ Import Namespace="mojoPortal.Business.WebHelpers" %>
<%@ Import Namespace="mojoPortal.Web.Framework" %>
<%@ Import Namespace="mojoPortal.Web.Controls" %>
<%@ Import Namespace="mojoPortal.Web.Editor" %>
<%@ Import Namespace="mojoPortal.Net" %>

<script runat="server">

Sub Page_Load()

lblTest.Text = "Hello Web"

End Sub

</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>VB.NET Test</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label id="lblTest" runat="server" />
</form>
</body>
</html>

Same thing should work for UserControls, with inline code the language is declared in the page or control.

However, working with mojoPortal may also be seen as an opportunity to learn C#. I've done plenty of work in VB.NET but I find C# so much cleaner, VB is so verbose ;-)

Hope it helps,

Joe

7/3/2009 9:10:08 AM
Gravatar
Total Posts 10

Re: VB.NET

<<For example here is a simple hello world in VB.NET, you can create a text file VBTeast.aspx and paste in this code, then drop the file in your mojo site and it will work.>>

I am new to this but I like this approche to adding pages, as I have a lot of data driven pages created wth vb.net.  It will be pretty simple to convert them to this.

My question is can you give me some more detail on how to add the page to the site after I "drop the file into your mojo site".

Where do I put the file?  

How do I add the page?

Thanks

Matt

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