.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to track user's time spent on a page

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net

Hi all-

I've got a dynamic page where I'd like to track the time the user spends on it. 

Can someone point me in the right direction?

View Complete Post

More Related Resource Links

Help building a user control to track page visits



My intention is to give the user a flexible user control on a master page that does the following:

  1. When navigating, a child page will pass the URL (with querystring) and PageTitle to the user control
  2. The user control will take those two parameters and insert them as a "breadcrumb" object at first index of a List<breadcrumb> collection

This part works fine through the use of a Repeater with a LinkButton contained in an ItemTemplate. The user sees each of the pages he has been visiting in descending order, the provided benefit is a quick way to re-open records they have recently modified or created.

The part I'm having trouble handling is what happens when the user clicks the LinkButton, which is that the child page adds a new reference to the URL at the beginning of the List<> collection and I cannot seem to control the behavior of removing the LinkButton before it gets re-created. What I've tried doing is:

Repeater1.DataSource = List<>;

While that should work, my CreateBreadCrumb(string url, string title) function gets called by the child page before the UserControl detects the Repeater1_Ite

How to track the changes of user contacts(colleagues) by using SharePoint API

We might have seen colleague tracker web part which keep tracks the changes made in our contacts/colleagues details like profile/lists/sites. The same tracking mechanism can be implemented by using MOSS API in any custom web part/ web control/ feature/web service...

UserProfile.GetColleagueChanges is the method which returns all changes happened with the contacts, this method also accepts a Query (UserProfileChangeQuery) where we can specify different parameters to filter the changes

Building Re-Usable ASP.NET User Control and Page Libraries with VS 2008


I am having problems with a user control. I want my solution to have a separate project for holding my user controls.

The main project can get a reference to this user control project and can import this user control dll into my main project. 

Thanks in advance,

Dheeraj Mittal


Crystal Report Asking for Database Authentication each time when I view Page.


Whenever I open my Crystal Report page, I am taken to the Database Authentication page where I am asked for

User name
Data Name

each time.

Is there a way to avoid this and I save these authentication in my page once.

I am using VS2005, C#.

Any Help will be appriciated.


Knowing the event occured in user control in current page




      My web application has user control which uses third party controls called Devexpress controls. The user control is a menu  and is part of the Master page. It is placed there because this needs to be available in all the pages. My user controls raises a even on item clicked. Now, My question is that Is there any way to know that the event has occurred in page_load of the current page in which I am in?

How to process data AFTER page is completely loaded for the user?


I have some logging that has to be done, which are some database update or inserts.

However this logging is of no importance to the user, so I only want to process the data/logs after the page is completed for the user.
As of now, if I process the data while the page is loading, I go from 1.4 to 2.0 speed (server side time processing of code), which is quite a bit comparing it is of no use to the user.

So I want this code only executed after that the page is complete.

I've been checking out Ajax, async pages etc, but the problem is it still gets executed before the page is rendered to the client, which means the client will have to wait longer then it is not being processed.

I've been checking out Threadpool.queueBackgroundWorker, however if I get it correct, this will still be executed before the page is shown to the user, as it has to complete before the prerender.

Then I thought about creating a new thread, and do the processing there, which would not have my page waiting to complete the data/logging.
However when I have 100 or 200 users loading pages at the same time, then that would mean I would be creating 200 threads on those loads, which I doubt will be good for performance. So if I want to solve this, I would have to create my own threadpool and only assign for example a max of 40 threads to it which can pr

Slow page load during a list query one time during the day


We have a monitoring tool set to check to see if the home pages for our 3 web apps load in under 60 seconds every 10 minutes.  All 3 web apps load in under 3 seconds on every 10 minute check except for one exception.  One check every day one of the web app's home page takes longer than 60 seconds to load.  This happens at 11:45PM when there is very little user usage on the environment.  The characteristics of this page are as follows: The only thing on the page is a list view web part which was added by the browser.  The page has not been customized with SPD or code at all.  The list that it pulls is a simple links list that has 281 items on it.  The view pulls all 281 items and displays them in sets of 100.  I cannot find any associated event in the server events and/or SharePoint ULS logs nor are there any daily sharepoint timer jobs running at that time.  Our full index happens at midnight with incremental happening hourly.  Our enviroment is 2 WFEs, 1 App/indexer and we have a separate SQL cluster backend.  

Could someone lead me possibly in the direction I should take next in my troubleshooting?   

Blank Managing My Links Page for Just One User



I've got a single user who's not able to manage his links in MOSS 2007. The links I speak of are gotting to via http://<<your:mysite>>/_layouts/myquicklinks.aspx. Other users have no issue.

I read somewhere that this might be caused by the user in question having added an improperly formated link. My issue is how can I check for that condition and correct it? Any thoughst would be much appreciated.





User Control not accessing the value of the properties send to it from the aspx page.


I have a dynamic accordion on a page. Set its datasource to an object of paged data source.The user control is in the accordions content template. When i was writing code the properties were showing but after giving the values of databases as


<uc:UserControl1  runat="server" Property1='<%#DataBinder.Eval(Container.DataItem,"columname1")%>' Property2='<%#DataBinder.Eval(Container.DataItem,"columname2")%>'  ></uc:UserControl1>


but the values shows null, these properties are shown as textboxes text property by user control.

MoreOver when I checked the values of database Items.So i made a textbox instead of usercontrol here as

<asp:TextBox ID="txtTest" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Columname1")%>'></asp:TextBox>

It is showing the correct value. And if i pass the value directly it is also showing correctly like

<uc:UserControl1  runat="server" Property1="XYZ")%>' Property2="ABC")%>'  ></uc:UserControl1>

. where I am wrong

the problem is eval is not passing the value to usercont

How show the computer user into a label in a master page

  Hello all, I'm creating a web site and I have this question, I installed a label with the name Userlbl in the master page, and the idea that I have, is when somebody opens the website, the label shows the computer's user, in my case Welcome: "Charly_csh" I tried with this code, that I used before in access and it works, when I load the page on the localhost, but when I load on the server, it shows NETWORK SERVICE The code is this: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Userlbl.Load Dim wshNetwork As Object 'New wshNetwork wshNetwork = CreateObject("WScript.Network") Me.Userlbl.Text = wshNetwork.UserName wshNetwork = Nothing End Sub Does somebody have an idea???       

Is there a function in Jquery which run only one time no matter load page or PostBack

In asp.net, I can use Method A to run somethings A one time, and somethings A will nor run when page is postback but In JQuery, I hope to run something B one time when the page is loaded, but if I use Method B, the "Somethings B" always run even the page is pastBack, how can I do? Thanks! ------------------Method A------------protected void Page_Load(object sender, EventArgs e){    if (!IsPostBack)    {       //Do Somethings A    } }   ------------------Method B------------$(document).ready(function () {   //Do Somethings B})

Long execution times for Search pages even after 4th or 5th user has accessed the same page.

Hi Guys We have a Sharepoint 2010 farm with two NLB web fronts ends, a Index server and a two box SQL cluster. The same problem also occurs on a dev box which has Sharepoint 2010 and SQl server running on the same single box. When a user access the search or advanced search page we get long execution times of between 15 and 30 seconds.  The strange thing is that the user will have a slow response the first time, then they are fine for a period of an hour or two and then they hit the slow response again.  Below i have copied info from the developer dashboard.  Does anyone have a suggestion of where to start tackiling this issue. Thanks 1st Run.  (Note this site was accessed by 3 other users first) BeginRequestHandler (0.05 ms) PostAuthenticateRequestHandler (0.06 ms) PostResolveRequestCacheHandler (18.48 ms) GetWebPartPageContent (16.87 ms) GetFileAndMetaInfo (15.57 ms) GetWebPartPageContent (35.25 ms) GetFileAndMetaInfo (34.99 ms) GetWebPartPageContent#1 (89.27 ms) GetFileAndMetaInfo (89.06 ms) Add WebParts (3975.17 ms) Search Box (3974.54 ms) SearchBoxEx.OnLoad (15426.56 ms) SearchBoxEx.HandleContextualScoping (0.01 ms) UserPreference.GetUserPreference (15418.52 ms) UserPreference.GetFromCache (0.04 ms) SearchServiceApplicationProxy.GetUse

Customize the User Profile page

I need to add a "link" or "button" to the User Profile page (userdisp.aspx).  In SP2007, I had a custom feature that would forward the user to a custom aspx page, but that doesn't appear to work in 2010.  Is there a recommended method of customizing the User Profile page in 2010?

How to Create a Curriculum Vitae For every user on there profile page?

Hi, I have to create a Curriculum Vitae on everyones users profile page so they can fill it in and afterwards we can do searches on it to see the experience of our people. This has to be done in a webpart. All ideas are welcome... i have no idea how i need to start on this.. i was thinking of making a list and saving all data of everyuser in the list (but if i put a webpart on the profile page i guess i will only have 1 list for all users or not?). Or maybe creating a wiki with all the userprofiles and then a webpart that query's the wiki.. but will the search work then?   What would be the best sollution?  I'm working with sharepoint 2010 Enterprise Thanks a lot!!!   TIM

Redirecting to custom page while clicking on the user/group browse button

Hi, i have created a custom visual web part in visual studio 2010 and i deployed it into sharepoint site by creating a new page in my site. The custom page gets the data of users/groups from database and pass the users to the people picker in sharepoint.Here my question i have a document library where we upload document and get the users page popup that consists of people picker and a user/group browse button.when i click on the (book image button)browse button it will redirect to the user and group search page but here i need to replace my custom  user/group search page with the default one so please help me how to redirect to the custom page by clicking on the user/group browse button,and i need to pass the selected users to the people picker text box........please give me some solution whether this can be done or not if possibe please send me the link or some sample code how to do this   thank you.

Track declining information over time

I am having some annoying problems, both based on the same principles. For the first issue, I am trying to track a census.  Basically, I have a list of people at a place, and want to figure out how many came in, and how many left, which will give me a positive or negative number. I want to compare this number to the original count of everyone, and then increase or decrease the amount by that factor. For example"   Starting number of people: 400     People Added: 2  People Subtracted: 10 Net loss or gain: -8  New number: 392.   I want that number that keeps track of everyone to be plotted out by month, in a line graph, so my chart would be something like   400 350        0 300                                0 250                                                 0            August             S

First time facing this problem in aspx page how to solve this..go to now

Hi . We have developed an asp.net application in Visual Studio 2008 with built in crystal report version =10.5.3700.0 , which is working fine in our local server. Our hosting server has crystal report file version =, Which is running on windows server 2008 (x64) with IIS 7. On load my crystal report aspx page am getting the following error. Error in File UNKNOWN.RPT: The request could not be submitted for background processing. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.  Exception Details: System.Runtime.InteropServices.COMException: Error in File UNKNOWN.RPT: The request could not be submitted for background processing. Source Error:  Line 32:         string user = ConfigurationManager.AppSettings["Userid"]; Line 33: Line 34:         crReportDocument.Load(Server.MapPath("CrystalReport.rpt")); Line 35: Line 36:         crConnectionInfo.ServerName = Server1; Source File: d:\inetpub\vhosts\xxxx.com\httpdocs\DT\Default.aspx.cs    Line: 34  Stack Trace:  [COMException (0x800002ad): Error in F
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend