Guest User

Untitled

a guest
Nov 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public partial class Default2 : System.Web.UI.Page
  2. {
  3. string minima = "Good Evening";
  4. protected void Page_Load(object sender, EventArgs e)
  5. {
  6. if (!Page.IsPostBack) {
  7. TextBox1.Text = minima;
  8. ViewState["Count"] = 0;
  9.  
  10. }
  11. Label1.Text = "Currently online " + Convert.ToString(ViewState["UserCount"]) + " users";
  12. Label2.Text = "Clicks from previous users: " + ViewState["Count"].ToString();
  13. }
  14.  
  15. protected void Button1_Click(object sender, EventArgs e)
  16. {
  17.  
  18. TextBox2.Text = TextBox1.Text;
  19. ViewState["Count"] = Convert.ToInt32(ViewState["Count"]) + 1;
  20. Label3.Text = "Curent Clicks: " + Convert.ToString(ViewState["Previous"]);
  21. }
Add Comment
Please, Sign In to add comment