Supporting Page Link in Custom Module Issue

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.
2/24/2015 9:52:20 PM
Gravatar
Total Posts 55

Supporting Page Link in Custom Module Issue

I am using mojo version 2.4.0.8 and having an issue with a supporting page links in a custom module. If I code the link as below the "href" attribute will not render, however if I leave the NavigateUrl off and use code behind to assign the value it works


            <asp:HyperLink ID="lnkEdit" 
                runat="server" 
                Text ="Edit Page" 
                NavigateUrl='<%# SiteRoot + "/TestModule/EditPage.aspx?pageid=" + PageId + "&mid=" + ModuleId %>' />

 

THIS WORKS:

(Markup)

     <asp:HyperLink ID="lnkEdit" 
                runat="server" 
                Text ="Edit Page" />

(Code Behind)

this.lnkEdit2.NavigateUrl = SiteRoot + "/TournamentManager/EditPage.aspx?pageid=" + PageId + "&mid=" + ModuleId;

Using the code behind is just a bit heavy it seems. Any help with this is greatly appreciated
 

2/25/2015 11:51:26 AM
Gravatar
Total Posts 18444

Re: Supporting Page Link in Custom Module Issue

I don't see a problem with either way, so I don't know why it isn't working for you, except if any value that you concatenate as part of the url is null then the whole thing becomes null and that might explain it. So make sure SiteRoot, PageId, and ModuleId are not null, otherwise I have no idea.

2/25/2015 4:51:40 PM
Gravatar
Total Posts 55

Re: Supporting Page Link in Custom Module Issue

Joe,

SiteRoot is coming back null in the markup

2/26/2015 9:16:50 AM
Gravatar
Total Posts 18444

Re: Supporting Page Link in Custom Module Issue

That is strange if you are using a control that inherits from SiteModuleControl

I would try replace SiteRoot with 

SiteUtils.GetNavigationSiteRoot()

for a root level site that may return empty string but empty string is not null

2/28/2015 12:06:49 PM
Gravatar
Total Posts 55

Re: Supporting Page Link in Custom Module Issue

Joe,

Tried both ways and still comes back null but code behind works.. sticking with Code behind for now until I further understand the problem..

Thank you for your response

 

 

Joe

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