Click here to Skip to main content
11,640,521 members (61,899 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
sir,
if i enter any value like 5 in a text box then the submit button click work only 5 times not more than 5 times.

thank in adv.

plz, reply
Posted 18-Nov-12 19:19pm
anshu77473
Comments
Subrata_Kolkata at 19-Nov-12 1:30am
   
Specify in details what you want to do.
OriginalGriff at 19-Nov-12 3:02am
   
And what have you tried? Where are you stuck?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

int i=0;
public void Button_Click(object sender EventArgs e)
{
    Textbox.Attributes.Add("readonly", "true");
    i=Convert.ToInt32(Textbox.value);
    if(i<=0)
       Button.diabled=true;
    i--;
    Textbox.value=i.toString();
}


In this program we disable the textbox in the button click event so the user cannot change the data in the textbox.

and we are retrieving the value in the textbox and checking if it is less than or equal to 0 the button is also get disabled otherwise we decrement the value in the textbox by 1 and updating it so that we can use the updated value in the next button click event.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Mika Wendelius 330
1 OriginalGriff 175
2 Afzaal Ahmad Zeeshan 130
3 CPallini 125
4 Sergey Alexandrovich Kryukov 94
0 Mika Wendelius 200
1 OriginalGriff 145
2 CPallini 115
3 jgakenhe 40
4 sasanka sekhar panda 30


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100