if i click first time button i want to display 1 on form ,
if i click second time button i want to display 2 on form ,
if i click third time button i want to display 3 on form ,
if i click fourth time button i want to display 4 on form ,
keep on clicking button i want number wil increase in window form in asp.net plz give code
Loading
Shivanand ArurPosted Oct 14, 2012, 7:26 AM
PLEASE MARK THE ANSWER AS CORRECT IF IT HELPED YOU!!!
Satyapriya NayakPosted Oct 14, 2012, 7:15 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Count_Button_Click_in_Asp.Net._Default" %>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace Count_Button_Click_in_Asp.Net
{
public partial class _Default : System.Web.UI.Page
{
protected void btn_count_Click(object sender, EventArgs e)
{
ViewState["count"] = Convert.ToInt32(ViewState["count"]) + 1;
Label1.Text = ViewState["count"].ToString();
}
}
}
Thanks
If this post helps you mark it as answer