VBtest.aspx

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/23/2010 3:06:58 AM
Gravatar
Total Posts 22

VBtest.aspx

Hi,

I've created the file VBtest.aspx (taken from your example). But where I need to copy it? In the root of the website? Do I need to make other modification?

Thanks for help

Yves

4/23/2010 6:40:16 AM
Gravatar
Total Posts 18439

Re: VBtest.aspx

Hi Yves,

What example are you referring to? Can you link to it? I don't remember making an example named VBTest.aspx.

Best,

Joe

4/23/2010 7:33:41 AM
Gravatar
Total Posts 22

Re: VBtest.aspx

4/24/2010 9:13:30 AM
Gravatar
Total Posts 22

Re: VBtest.aspx

Hi Joe,

Did you already had some time to look at my request.

Thanks.

Yves

4/24/2010 9:24:34 AM
Gravatar
Total Posts 18439

Re: VBtest.aspx

Hi Yves,

That is not a good example, it doesn't use mojoBasePage and would therefore not blend with the site if you plug it in. I will post a better example soon for VB.NET below.

Really mojoPortal is designed for you to develop features that start with a UserControl (.ascx) not a page, the UserControl can link to supporting pages but really it is not ideal to try to plugin free standing .aspx pages.

It is possible to do it though. You can put the physical page wherever you like on disk assuming it uses inline code instead of a codebehind file. Then you create a page the normal way but set the url to ~/pathtoyourpage.aspx. It will give a warning about pointing to a physical file but it will let you do it. If the page inherits from mojoBaseBage and has the correct content placeholders then it will blend visually with the site.

Here is a better VB.NET example that uses mojoBasePage:

<%@ Page Language="VB" ClassName="VBTest.aspx" Inherits="mojoPortal.Web.mojoBasePage" MasterPageFile="~/App_MasterPages/layout.Master" %>
<%@ 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()

litHeading.Text = "My Heading"
TextBox1.Text = "Hello Web"

End Sub

Sub Button1_Click(sender As Object, e As System.EventArgs)
TextBox1.Text = "You clicked the button."
End Sub

</script>

<asp:Content ContentPlaceHolderID="leftContent" ID="MPLeftPane" runat="server" />
<asp:Content ContentPlaceHolderID="mainContent" ID="MPContent" runat="server">
<portal:mojoPanel ID="mp1" runat="server" ArtisteerCssClass="art-Post" RenderArtisteerBlockContentDivs="true">
<mp:CornerRounderTop id="ctop1" runat="server" />
<asp:Panel id="pnl1" runat="server" CssClass="panelwrapper ">
<h2 class="moduletitle"><asp:Literal ID="litHeading" runat="server" /></h2>
    <portal:mojoPanel ID="MojoPanel1" runat="server" ArtisteerCssClass="art-PostContent">
<div class="modulecontent">

Your custom form goes here.
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />

</div>
</portal:mojoPanel>
 <div class="cleared"></div>
</asp:Panel>
<mp:CornerRounderBottom id="cbottom1" runat="server" />
</portal:mojoPanel>
</asp:Content>
<asp:Content ContentPlaceHolderID="rightContent" ID="MPRightPane" runat="server" />
<asp:Content ContentPlaceHolderID="pageEditContent" ID="MPPageEdit" runat="server" />

Hope it helps and many thanks for the beers!

Best,

Joe 

4/24/2010 9:27:17 AM
Gravatar
Total Posts 18439

Re: VBtest.aspx

One of the drawbacks to plugging in a page like this, is it may not in all cases be able to correctly highlight the menu, in some cases it will work but in others it will not depending on the menu structure and where the page is located in the site hierarchy.

This is why it is better to use a UserControl that inherits from SiteModule which can be plugged in as a feature on any page.

Best,

Joe

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