i want to find count of number of times button is clicked.
if i click the button 10 times, it have to print 10.
Action performance
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 10, 2013, 11:15 PM EDT
try this:
in aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
in .cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
static int i = 0;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
i++;
Label1.Text = "Count :" + i;
}
}
Manj N144 reputationPosted Sep 10, 2013, 11:19 PM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 10, 2013, 11:28 PM EDT
try this by using javascript:
Manj N144 reputationPosted Sep 10, 2013, 11:31 PM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 10, 2013, 11:51 PM EDT
if you want to do it in using java then . you have to use servlet or jsp.
Mark it as answered if it helps you.