实现:点击链接跳转到对应页面
点击编辑后
解决:
借助Lable,TextBox和Button 实现
1、显示时隐藏TextBox 控件,点击编辑后隐藏 Lable 控件
页面
lable 的展示,在内部传递一个超链接给lable,通过subString 控制 lable 显示的长度
//textbox this.tbJobDept_info_ZhaoPinWebSite.Text = _job_deptinfo.JobDept_info_ZhaoPinWebSite.ToString(); //lable if(_job_deptinfo.JobDept_info_ZhaoPinWebSite.Length > 40) { this.labtbJobDept_info_ZhaoPinWebSite.Text = "<a href='" + _job_deptinfo.JobDept_info_ZhaoPinWebSite.ToString() + "' target='_blank'>" + _job_deptinfo.JobDept_info_ZhaoPinWebSite.Substring(0,40) + "</a>"; } else { this.labtbJobDept_info_ZhaoPinWebSite.Text = "<a href='" + _job_deptinfo.JobDept_info_ZhaoPinWebSite.ToString() + "' target='_blank'>" + _job_deptinfo.JobDept_info_ZhaoPinWebSite + "</a>"; }
2、点击 Button 按钮,内部控制 Lable,TextBox的隐藏与显示
protected void btnUptZhaoPinWebSite_click(object sender,EventArgs e) { this.tbJobDept_info_ZhaoPinWebSite.Visible = true; this.labtbJobDept_info_ZhaoPinWebSite.Visible = false; }