Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["User"] == null)
     {
         Response.Write("<script>alert('账户过期请重新登录!');window.parent.location.href='Login.aspx';</script>");
     }
     try
     {
         QueryType = Request.QueryString["type"].ToString().Trim();
     }
     catch
     {
         QueryType = "学院概况";
     }
     if (!IsPostBack)
     {
         User u = (User)Session["User"];
         if (TeacherHelper.Select(u.UserID) == null)
         {
             Response.Redirect("Index.aspx");
         }
         try
         {
             //绑定子分类
             dplType.DataSource = IntroduceHelper.getSubType(QueryType);
             dplType.DataBind();
             //初始化内容
             if (QueryType == "合作办学")
             {
                 CoopBuild.Visible = true;
             }
             Introduce intr = new Introduce();
             if (QueryType == "专业介绍")
             {
                 //绑定子分类关联分类
                 dplSubType.DataSource = IntroduceHelper.getSubTypeRelationItem(dplType.SelectedValue);
                 dplSubType.DataBind();
                 dplSubType.Visible = true;
                 intr = db.Introduce.SingleOrDefault(p => p.name == "专业介绍:物理学");
             }
             else if (QueryType != "合作办学")
             {
                 intr = db.Introduce.SingleOrDefault(p => p.name == "学院概况:学院介绍");
             }
             myEditor11.InnerHtml = intr.text;
         }
         catch { myEditor11.InnerHtml = ""; }
     }
 }
Beispiel #2
0
    //protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    try
    //    {
    //        Introduce intr = db.Introduce.First(p => p.name == DropDownList1.SelectedValue);
    //        myEditor11.InnerHtml = intr.text;
    //    }
    //    catch {
    //        myEditor11.InnerHtml = "";
    //    }
    //}

    protected void dplType_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (QueryType == "专业介绍")
        {
            dplSubType.DataSource = IntroduceHelper.getSubTypeRelationItem(dplType.SelectedValue);
            dplSubType.DataBind();
            dplSubType.Visible = true;
            SubContentBind();
        }
        else
        {
            try
            {
                Introduce intr = db.Introduce.First(p => p.name.Contains(QueryType + ":" + dplType.SelectedValue));
                myEditor11.InnerHtml = intr.text;
            }
            catch
            {
                myEditor11.InnerHtml = "";
            }
            dplSubType.Visible = false;
        }
    }