error when adding a custom module to the Administration panel

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.
1/13/2011 3:13:16 AM
Gravatar
Total Posts 50

error when adding a custom module to the Administration panel

Hi,

im trying to create a custom control that will appear in the administration panel.

these are the steps i took:

1. created the module control (log.ascx) and copied the files during the build to the  "Web/Admin/Controls" folder

2. created the .config file

<?xml version="1.0" encoding="utf-8" ?>
<adminMenuLinks>
    <adminMenuLink
    resourceFile="MyResource"
    resourceKey="connection Log"
    url="~/Admin/Controls/log.ascx"
    visibleToRoles="Admins;Content Administrators"
    cssClass="yourcssclass"
/>
</adminMenuLinks>

 

3. copied it in the build to the initialcontent folder like specified in the tutorial

now. the menu item appears in the admin panel but when i click it i get an error:

This type of page is not served.

Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.ascx' may be incorrect. Please review the URL below and make sure that it is spelled correctly.

Requested URL: /Admin/Controls/log.ascx

 

where did i go wrong ?

Thanks

1/13/2011 3:40:05 AM
Gravatar
Total Posts 550

Re: error when adding a custom module to the Administration panel

Hi ,

Adding custom items not means adding custom user controls , the url it your custom item must be a valid global url or an relative page in the site with a correct extention (i.e .aspx) . You could add your custom .ascx to page and set it as the rul it you custom admin menu item.

Hope Helps

Asad

1/13/2011 3:50:48 AM
Gravatar
Total Posts 50

Re: error when adding a custom module to the Administration panel

Thanks Asad but im not sure i understand.

can you explain how i would add my custom gridview to the administrator panel ?

if this means creating a .aspx page - can you point me to a tutorial on creating a custom aspx page, and also how i can would define it in the config file ?

Thanks

1/13/2011 4:03:45 AM
Gravatar
Total Posts 550

Re: error when adding a custom module to the Administration panel

Hi ,

For straightforward  and faster getting result copy one of the pages(i.e AdminLanguage.aspx) in the web/admin folder and rename it as what you want , and customize the code bihind and html of it as you need. So you can add an item as following.

<?xml version="1.0" encoding="utf-8" ?>
<adminMenuLinks>
<adminMenuLink
resourceFile="MyResource"
resourceKey="connection Log"
url="~/Admin/Controls/YourPageName.aspx"
visibleToRoles="Admins;Content Administrators"
cssClass="yourcssclass"
/>
</adminMenuLinks>

Hope Helps

Asad

1/13/2011 4:17:47 AM
Gravatar
Total Posts 50

Re: error when adding a custom module to the Administration panel

thanks

1/13/2011 11:46:03 AM
Gravatar
Total Posts 50

Re: error when adding a custom module to the Administration panel

ok, so i have used the AdminLanguage.aspx as a starting point.

i replaced this line:

<mp:mojoGridView ID="grdLanguage" runat="server" AllowPaging="false" AllowSorting="false"
                AutoGenerateColumns="false" DataKeyNames="Guid" EnableTheming="false">

with my own grid ID:

<mp:mojoGridView ID="GridView1" runat="server" AllowPaging="false" AllowSorting="false"
                AutoGenerateColumns="false" DataKeyNames="Guid" EnableTheming="false">

i get a compilation error:

Error 78 'xxx.Web.UI.Admin.ConnectionLog' does not contain a definition for 'GridView1' and no extension method 'GridView1' accepting a first argument of type 'xxx.Web.UI.Admin.ConnectionLog' could be found (are you missing a using directive or an assembly reference?) C:\....\xxx.Web.UI\Admin\ConnectionLog.aspx.cs 42 22 xxx.Web.UI

 

with <asp:GridView  it build fine.

where do i need to register the id of my gridview ? i dont see any reference to it in the source behind or the design file.

Thanks
 

1/13/2011 11:58:09 AM
Gravatar
Total Posts 550

Re: error when adding a custom module to the Administration panel

Hi ,

The mojoGridView implemented in the mojoPortal.Web.Controls project and you need to reference it in your xxx.Web.UI project.

Hope Helps,

Asad

1/15/2011 3:45:29 AM
Gravatar
Total Posts 50

Re: error when adding a custom module to the Administration panel

Hi,

i have referenced the library but im still getting the same error.

unrecognized tag prefix or device filter 'mp'

on the

  <mp:mojoGridView ID="GridView1" runat="server"

in the code view of the .aspx page.

there must be something else missing

thanks

 

1/15/2011 7:05:23 AM
Gravatar
Total Posts 18439

Re: error when adding a custom module to the Administration panel

If this is in your own custom Web ui project you need to copy the <pages... section from the mojoPortal Web.config and replace the same section in your custom project Web.config and you need to set references to mojoPortal.Web project and mojoPortal.Web.Controls project.

Hope it helps,

Joe

1/16/2011 3:48:00 AM
Gravatar
Total Posts 50

Re: error when adding a custom module to the Administration panel

Thanks Joe, i'll give it a try.

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