protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) { Response.Redirect("../Login.aspx"); } else { if (!IsPostBack) { DDLType.DataSource = bll.GetCodeTable(); DDLType.DataBind(); CodeGridView.DataSource = bll.GetTypeByID(Convert.ToInt32(DDLType.SelectedValue)); CodeGridView.DataBind(); } } }