URL for paging function

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.
7/27/2011 11:34:45 AM
Gravatar
Total Posts 199

URL for paging function

I have built a custom feature that has some paging basically only PREV and NEXT.  When I built paging functions in the past I would call - Request.CurrentExecutionFilePath - to get the page that I was on so I could pass the page number.  In mojo I know it is always on the same page so I would like to know how to grab the current page URL so I can page a page number like this:  pageName.aspx?page=2

Thank you

8/2/2011 9:19:50 AM
Gravatar
Total Posts 199

Re: URL for paging function

Just an update: I have a temporary solution where I created a setting so that the user needs to enter the page url where the feature is located so that the paging works correctly.  For example a user will enter ~/page_name.aspx and anytime there are enough items on a page the NEXT and PREV will be populated with that setting url.

It seems as I should be able to use the FriendlyURL class to automatically find the page where the feature is installed and that is what I am still working on.

hope this helps someone or if you know a better way please share.

8/2/2011 9:34:33 AM
Gravatar
Total Posts 76

Re: URL for paging function

If your Custom Module is a SiteModuleControl, you can get the current friendly url for the page by:

this.currentPage.Url

then you could add you paging params to the end: Example:

var nextUrl = this.currentPage.Url + "?pg=" + nextPageId.ToString();

"~/my-friendly-url.aspx?pg=3"

 

8/2/2011 9:59:14 AM
Gravatar
Total Posts 199

Re: URL for paging function

EXCELLENT!  that is exactly what I needed THANK YOU!

Working great now.

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