Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string url = Request.RawUrl.ToLower();
            if (url.IndexOf("zcdetail1.aspx") > 0)
            {
                LinkButton1.ForeColor = Color.Red;
            }

            if (url.IndexOf("zcdetail1.aspx") > 0)
            {
                LinkButton1.ForeColor = Color.Red;
            }

            if (url.IndexOf("zcdetail2.aspx") > 0)
            {
                LinkButton2.ForeColor = Color.Red;
            }

            if (url.IndexOf("zcdetail3.aspx") > 0)
            {
                // LinkButton3.ForeColor = Color.Red;
            }

            if (url.IndexOf("zcdetail4.aspx") > 0)
            {
                // LinkButton4.ForeColor = Color.Red;
            }

            if (url.IndexOf("zcdetail5.aspx") > 0)
            {
                LinkButton5.ForeColor = Color.Red;
            }

            if (url.IndexOf("zcdetail6.aspx") > 0)
            {
                LinkButton6.ForeColor = Color.Red;
            }

            if (url.IndexOf("zcdetail7.aspx") > 0)
            {
                LinkButton7.ForeColor = Color.Red;
            }

            if (url.IndexOf("zcdetail8.aspx") > 0)
            {
                LinkButton8.ForeColor = Color.Red;
            }
            if (url.IndexOf("zcdetail9.aspx") > 0)
            {
                LinkButton9.ForeColor = Color.Red;
            }
            if (url.IndexOf("zcdetail11.aspx") > 0)
            {
                LinkButton11.ForeColor = Color.Red;
            }


            #region 计算资产的上一个和下一个
            //得到上一个ID和下一个ID
            if (Request["id"] != null && Request["id"].ToString().Trim() != "")
            {
                String nextid, previd;
                U_ZCBU zc1  = new U_ZCBU();
                String url1 = Request.Url.AbsoluteUri;


                zc1.GetNextAndPrevID(Request["id"], out nextid, out previd);
                if (previd != String.Empty)
                {
                    this.prevUrl.NavigateUrl = url1.Replace(Request["id"], previd);
                }

                if (nextid != String.Empty)
                {
                    this.nextUrl.NavigateUrl = url1.Replace(Request["id"], nextid);
                }

                //Response.Write(previd);
            }
            #endregion

            #region 计算资产的相关链接
            String czid = null;
            if (Request["id"] != null && Request["id"].ToString().Trim() != "")
            {
                czid = this.GetZcCzid(Request["id"]);
            }
            if (String.IsNullOrEmpty(czid) == false)
            {
                this.HyperLink1.Visible     = true;
                this.HyperLink1.NavigateUrl = "~/ZcMng3/EditSbb.aspx?id=" + czid;
            }
            else
            {
                this.HyperLink1.Visible = false;
            }
            #endregion
        }
    }