Inheriting from "System.Web.UI.Page"

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/7/2011 4:41:53 AM
Gravatar
Total Posts 14

Inheriting from "System.Web.UI.Page"

Hello,

We are  doing a proof of concept on Mojoportal because our company's studying moving  from an old CMS to mojo portal.

I want to ask how we can implement a functionality that enables my website to insert into the some database the HTTP referrer for each page visited by the website visitor, I need also to write some cookie from each page visited.

In the traditional ASP .Net development , we used to inherit the "System.Web.UI.Page" and then let all the website's pages to inherit from that new page. That new page contains all the common functionalities needs to be implemented on the website

If any one can send me a link to document or  small code, it'll come in handy

 

Many Thanks
Tarek

7/7/2011 7:38:47 AM
Gravatar
Total Posts 18439

Re: Inheriting from "System.Web.UI.Page"

I suggest that you could implement a custom HttpModule that will run on every request and you could do your logging from there using the Begin_Request event or End_Request event. You can plug in a custom HttpModule from Web.config, do some googling on it and you will find lots of tutorials. You could also set cookies that way, but I would be cautious of setting a cookie on every visited page, cookies have a limited size and if you try to put too much in there it will break things.

Other than that I would suggest invest some time into reading our developer documentation and watching the training videos, and study the source code for a few existing features, it will save you time in the long run.

Hope that helps,

Joe

7/7/2011 8:20:04 AM
Gravatar
Total Posts 14

Re: Inheriting from "System.Web.UI.Page"

Many Thanks Joe, 

I am using the cookies because the website visitors lands to our website from different web sites like search engine, affiliates' sites...etc (the referrer),  I use a permanent GUID cookie to save it as a unique identifier for  the website visitor to bind to the origin(lead source) of the website visitor, our business does a marketing campaign and the marketing department needs to know what is the lead source of the website, search engine, affiliates. etc. Marketing team needs to get a ad hoc reports. 

As for reading documentation, We already have the plan study it thoroughly, but currently we have a pretty tight schedule for deciding if we are going with MojoPortal or another CMS. we are in the phase of doing a proof of concept (POC) on three CMSs (MojoPortal, Sharepoint Server 2010 ,DotNet Nuke), to know which one most fits our business needs, the easy of development, performance, costs...etc .
My first impression about Mojoportal is fabulous and promising CMS. Keep it on

Your are help is very appreciated.


Tarek

 

 

 

7/7/2011 8:54:57 AM
Gravatar
Total Posts 18439

Re: Inheriting from "System.Web.UI.Page"

Hi Tarek,

That makes sense and doesn't sound like you are setting lots of cookies on each user, just keeping track of their initial entry point and referrer which seems quite reasonable to me.

One thing to keep in mind about the HttpModule is that it may fire on every request, depending on configuration it may fire even for static file requests.

Another solution would be to just make a custom server control or UserControl that doesn't render anything but does your tracking and cookie stuff. You could easily embed the control in the layout.master file of the skin. This way you would be sure your code would only fire on actual pages whereas with the HttpModule you would need to check the file extension of the request to make a decision whether to fire your logic. Either approach would work though.

Best,

Joe

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