But how does the page know which user came in and which user owns that page. I mean the page is display sheet. How does it know when I am logged in. that I am the owner and when some body other than me comes in, he is a visitor.
You have to store this relationship as well somehwere in the Database for ex.
An example could be that each pages' title is unique and you are maintaining the relationship in the DB like:
Page Title | User Id
Report1 Saurabh
Now on page load of each page you can check something like this:
protected void Page_Load(object sender, EventArgs e)
{
//Select userId from DB where title is Page.Title
String UserIdDB = "";
if (UserIdDB.CompareTo(User.Identity.Name) == 0)
{
//Don't store
}
else
{
//Store
}
}
nijhawan.sau...
All-Star
16398 Points
3172 Posts
Re: how to check the user who visits another users homepage.
May 01, 2012 12:17 PM|LINK
You have to store this relationship as well somehwere in the Database for ex.
An example could be that each pages' title is unique and you are maintaining the relationship in the DB like:
Page Title | User Id
Report1 Saurabh
Now on page load of each page you can check something like this:
protected void Page_Load(object sender, EventArgs e) { //Select userId from DB where title is Page.Title String UserIdDB = ""; if (UserIdDB.CompareTo(User.Identity.Name) == 0) { //Don't store } else { //Store } }