Running VBScript : HTTP Referrer

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.
3/4/2010 11:18:10 AM
Gravatar
Total Posts 4

Running VBScript : HTTP Referrer

Hi.

I am relatively new to web development, but am using MojoPortal.  I think that it is a very powerful, easy-to-use Content MAnagement System for creating websites.

 

I have a question about running VBscript.

I am developing a website for a client using MojoPortal.  One of the requirements of the project is that we use an HTTP Referrer to track the point-of-entry to the website.

I already have the VBScript code to track the point-of-entry, and write the information in a MSSQL database.  My question is:  Where do I insert this code for websites created in MojoPortal?

3/4/2010 12:32:07 PM
Gravatar
Total Posts 18439

Re: Running VBScript : HTTP Referrer

Sorry but VBScript is from Classic ASP, you cannnot use VBScript in ASP.NET.

4/2/2010 12:20:58 PM
Gravatar
Total Posts 6

Re: Running VBScript : HTTP Referrer

Joe-

Thanks for the reply.

I am guessing that writing a simple HTTP referrer that logs into a database in ASP.NET isn't that hard to do.  Assuming that I can write the code for that, how would I insert that code into the web pages I create in mojoportal?

 

4/3/2010 7:28:19 AM
Gravatar
Total Posts 18439

Re: Running VBScript : HTTP Referrer

You could create a UserControl and embed it in the layout.master file of your skin. In the page load event of the UserControl you could do your logging.

There is not always a referrer so you need to check for null like this:

if (Request.UrlReferrer != null)
 {
      // do logging
 }

There are lots of tutorials online about creating and using ASP.NET UserControls

Hope it helps,

Joe

4/13/2010 2:33:40 AM
Gravatar
Total Posts 4

Re: Running VBScript : HTTP Referrer

Has anybody been able to figure out how to store the CURRENT page name?  Either the URL of the current page, or the Title of the page would do.

I have tried using the Request.ServerVariable(foo) collection, but it doesn't work.  Every URL returned through that points to http://siteroot/default.aspx, instead of the page that the browser thinks it is pointed to.

 

4/13/2010 7:07:42 AM
Gravatar
Total Posts 18439

Re: Running VBScript : HTTP Referrer

Hi Kent,

To get the url you can use SiteUtils.GetCurrentPageUrl();

From a module control you can get a reference to the cuurent page with this.currentPage, in a page that inherits from mojoBasePage you also have this.CurrentPage

this.CurrentPage.PageName etc, you can access all the properties.

Please in the future, just ask one question per thread instead of asking new questions on an old un-related thread.

Best,

Joe

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