SetUrl(WebControls)
来源:互联网 发布:软件开发过程管理规范 编辑:程序博客网 时间:2024/06/04 18:39
protected AssistantBLL assistantBll = new AssistantBLL();//使用位置,设置图片private string _isRoot;public string isRoot{ get { return _isRoot; } set { _isRoot = value; }}src='<%= assistantBll.SetUrl("images/bantou_01.gif",isRoot) %>'style="background-image: url('<%= assistantBll.SetUrl("images/lshg2.gif",isRoot) %>');height: 65px"href='<%= assistantBll.SetUrl("aytk.html",isRoot) %>'Text='<%# assistantBll.GetStrByRealLen(Eval("OlympicImageExplain").ToString(),10) %>'//控件路径设置public string SetUrl(string strUrl,string isRoot){ switch (isRoot) { case "root": return strUrl; break; case "second": return strUrl = @"../" + strUrl; break; case "third": return strUrl = @"../../" + strUrl; break; case "true": return strUrl; break; case "yes": return strUrl; break; default: return strUrl; break; }}