Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
audit_trail (
Id bigint not null,
SessionId varchar(1000) not null,
Url varchar(1000) not null,
Referrer varchar(1000) null,
User varchar(50) not null,
VisitOrder bigint not null,
DateOfVisist datetime not null,
primary key (Id)
)
public class AuditTrail : IHttpModule
{
public void Init(HttpApplication context)
{
context.BeginRequest += LogVisit;
}
public void Dispose(){ }
private void LogVisit(object sender, EventArgs e)
{
var context = HttpContext.Current;
var sessionId = context.Session.SessionID;
var url = Context.Request.Url.ToString();
var referrer = Context.Request.UrlReferrer.ToString();
var user = Context.User.Identity.Name;
var visit = DateTime.Now();
var visitOrder = GetNextVisitIncrement();
//now save this data back to the database.
}
private long GetNextVisitIncrement()
{
//query database
select top 1 VisitOrder from audit_trail where [User] = @user order by VisitOrder desc;
// map row to Visit object and return
if(no rows exist) return 1;
return Convert.ToLong(row["VisitOrder"])+1L;
}
}