count every link,when user click any link,how can i do

Posted by Neha-kapoor under ASP.NET on 7/2/2011 | Points: 10 | Views : 2116 | Status : [Member] | Replies : 2
Dear all
i want to if any user clcik any link then link count if user click asp.net link then count if user click other link then count
evry give suggestion that i use session with global.asx but session variable count every link show every link sum
i want show every hits count differnt variable

thanks


Responses

Posted by: Ndebata on: 7/4/2011 [Member] Starter | Points: 25

Up
0
Down
Try to save it in database,
Try a add a column called VisitCount to the table where you are storing the C#, Asp.net etc,
The try to increase the number by one when ever a particular link is clicked.

Thanks,
Debata

Neha-kapoor, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
hi
try this in global.asax class write below code

<script runat="server">

public static int count = 0;
public static int count1 = 0;

void Application_Start(object sender, EventArgs e)
{
Application["myCount"] = count;
Application["myCount1"] = count1;

}
void Session_Start(object sender, EventArgs e)
{
count = Convert.ToInt32(Application["myCount"]);
count1 = Convert.ToInt32(Application["myCount1"]);

Application["myCount"] = count + 1;
Application["myCount1"] = count1 + 1;


}
</script>


in linkbutton1_click
int a;
a = Convert.ToInt32(Application["myCount"]);
Label1.Text = a.ToString("0000");

in linkbutton2_click

int a;
a = Convert.ToInt32(Application["myCount1"]);
Label2.Text = a.ToString("0000");

........


Thanks&Regards
LakshmiNarayana Nalluri.

Neha-kapoor, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response