How link to physical page with parameter on URL

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
3/5/2011 8:06:17 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

How link to physical page with parameter on URL

I'm a newcomer to mojoportal so apologies if this is a silly one!

mojoPortal Version 2.3.6.2 SqlCe
Operating System Microsoft Windows NT 5.2.3790 Service Pack 2
ASP.NET Info v4.0.30319 Running in Full Trust

Within my site I have a physical aspx page that connects to a database to show searchable data. I've created a link to this as a menu item no problem; here's the link I use

~/Data/Sites/1/userfiles/resultsarchive.aspx

But I'd like the menu item to pass a parameter to my aspx page, to pre-filter its results. When I try to add a param to the above link it gets automatically stripped out. i.e.

~/Data/Sites/1/userfiles/resultsarchive.aspx?year=2010

gets turned into

~/Data/Sites/1/userfiles/resultsarchive.aspxyear=2010

How do I stop it mashing the URL?

thanks

Crispin

 

3/5/2011 8:08:23 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: How link to physical page with parameter on URL

I should have said, my site is here

http://www.breconfans.org.uk

and the page I'm talking about is "All Results". I'd like to pre-filter this by adding year=2010 onto the URL.

ta

Crispin

3/5/2011 8:13:33 AM
Gravatar
Total Posts 18439

Re: How link to physical page with parameter on URL

You can solve it by using the fully qualified url starting with http:// instead of ~/

Note however that I do not recommend putting executable code such as .aspx pages down under the writable portion of the file system. For best security practices the /Data folder should be marked as not executable.

http://www.mojoportal.com/securing-the-file-system.aspx

Best,

Joe

3/5/2011 8:21:39 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: How link to physical page with parameter on URL

Excellent thanks Joe - that has worked fine.

Regarding your advice about not putting executable code under \Data...  where should I put this?

Also, at the moment my aspx is running with un-compiled code-behind (VB).  It works OK, but what's the next step to have this run compiled?  Do I need to re-build the whole solution in VS?

your help much appreciated

Crispin

3/5/2011 8:23:51 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: How link to physical page with parameter on URL

Also I've just noticed that when user goes to the menu item with the full page URL, the menu tabs do not operate correctly to reflect which page the user is looking at. Anything I can do to improve that?

ta

Crispin

3/5/2011 11:36:33 AM
Gravatar
Total Posts 18439

Re: How link to physical page with parameter on URL

Unfortunately not. But if you develop custom features in the suggested way instead of linking to .aspx pages from the menu then you will not encounter such problems.

You can use supporting pages in your feature and still have the menu highlight correctly by passing the pageid into the supporting page from the feature module control which would be loaded on the cms page.

http://www.mojoportal.com/developerdocs.aspx

Best,

Joe

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