Advertisement
SvetoslavUzunov

Поправка, вариант 1

Jun 2nd, 2021
1,356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.31 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7.  
  8. namespace WebApplicationDemo
  9. {
  10.     public partial class Popravka : System.Web.UI.Page
  11.     {
  12.         // 1
  13.         protected void Page_Load(object sender, EventArgs e)
  14.         {
  15.             Calendar1.Visible = false;
  16.         }
  17.  
  18.         protected void Button1_Click(object sender, EventArgs e)
  19.         {
  20.             if (TextBox1.Text == "Календар")
  21.             {
  22.                 Calendar1.Visible = true;
  23.             }
  24.             else
  25.             {
  26.                 TextBox1.Text = "Въведете текст - Календар";
  27.             }
  28.         }
  29.  
  30.         // 2
  31.         protected void Calendar1_SelectionChanged(object sender, EventArgs e)
  32.         {
  33.             var date = Calendar1.SelectedDate;
  34.             for (int i = 0; i <= 7; i++)
  35.             {
  36.                 ListBox1.Items.Add(new ListItem(date.ToShortDateString()));
  37.                 date = date.AddDays(1);
  38.             }
  39.         }
  40.  
  41.         // 4
  42.         protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
  43.         {
  44.             Session["destinationType"] = DropDownList1.SelectedValue;
  45.             Response.Redirect("PopravkaPage2.aspx");
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement