⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 people.aspx.cs

📁 个人网站开发模板
💻 CS
字号:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;



public partial class PeoplePage : System.Web.UI.Page
{
    ///<summary>
    /// Hides rows that have 'invisible' = false
    /// Also hides the image if none is defined
    ///</summary>
    protected void GridViewAllNews_RowCreated(object source, GridViewRowEventArgs e)
    {
        if (e.Row == null) return;

        if (e.Row.RowType == DataControlRowType.DataRow && e.Row.DataItem != null)
        {
            bool visible = (bool)DataBinder.Eval(e.Row.DataItem, "Visible");
            e.Row.Visible = visible;
        }

        // display image if a url is specifid
        string imageUrl = (string)DataBinder.Eval(e.Row.DataItem, "ImageUrl");
        if (String.Empty.Equals(imageUrl))
        {
            Image newsImage = (Image)e.Row.FindControl("Image2");
            if (newsImage != null)
                newsImage.Visible = false;
        }
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -