zoukankan      html  css  js  c++  java
  • [整理]VS2005,DetailsView1控件学习记录。

    I Use Visual Studio 2005 In My Project,Today I Find Some Problem.
    in my sql server 2005 database,there have a field(bit),i use the controls DetailsView,for show the Detail info.
    because the type bit's value true or false,but i can not to show true or false,i want to show the lock or unlock,here is the resolvent.

    note 1 ---use sql.
    this is the code:"select userlock=(case when userlock=0 then 'lock' else 'unlock' end)" form tablename";

    note 2 --- use databound
        protected void DetailsView1_DataBound(object sender, EventArgs e)
        {
            Label LabTemp = (Label)DetailsView1.FindControl("Label1");
            if (LabTemp.Text == "True")
            {
                LabTemp.Text = "lock";
            }
            else
            {
                LabTemp.Text = "unlock";
            }
        }
    上面第二条解决方法,必须将该列转化成模板列才行,否则是没办法改变显示的。

  • 相关阅读:
    PHP 单态设计模式
    五中常见的PHP设计模式
    PHP如何定义类及其成员属性与操作
    thinkphp 中MVC思想
    1.4 算法
    1.3 迭代器
    1.2 容器-container
    1.1 STL 概述
    2.3顺序容器-deque
    2.2 顺序容器-list
  • 原文地址:https://www.cnblogs.com/Apollo/p/364139.html
Copyright © 2011-2022 走看看