Increment the int value in the text box

jeniferdepth

New Member
I have a disabled text box thats' value only increments by one once a button is clicked, the problem is that it goes from 1 to 2 and thats it. I want it to increment everytime i push the button.\[code\]namespace StudentSurveySystem{ public partial class AddQuestions : System.Web.UI.Page { int num = 1; protected void Page_Load(object sender, EventArgs e) { QnoTextBox.Text = num.ToString(); } protected void ASPxButton1_Click(object sender, EventArgs e) { num += 1; QnoTextBox.Text = num.ToString(); } }}\[/code\]
 
Back
Top