For loop asp.net中string.format的分页

For loop asp.net中string.format的分页,for-loop,paging,string.format,For Loop,Paging,String.format,我知道如何为string.format分页。我只是喜欢在Gridview中分页。 例如,每页有20 100条记录,布局的其余部分 下一步预览123445 使用(var cmd=new SqlCommand(“newcontentmenu”,cn){CommandType=CommandType.StoredProcedure}) { 使用(var dr=cmd.ExecuteReader(CommandBehavior.CloseConnection)) { while(dr.Read()) {

我知道如何为string.format分页。我只是喜欢在Gridview中分页。 例如,每页有20 100条记录,布局的其余部分

下一步预览123445
使用(var cmd=new SqlCommand(“newcontentmenu”,cn){CommandType=CommandType.StoredProcedure})
{
使用(var dr=cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
while(dr.Read())
{
newsTabMenu.Controls.Add(new Literal(){Text=string.Format(“
”,dr[“NewsID”]、dr[“newsttitle”]); } } }
} 亲爱的朋友们,请帮我解决这个问题。感激的

        using (var cmd = new SqlCommand("NewsContentMenu", cn) { CommandType = CommandType.StoredProcedure })
        {
            using (var dr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
            {
                while (dr.Read())
                {
                    newsTabMenu.Controls.Add(new Literal() { Text = string.Format("<a href='News.aspx?id={0}'>{1}</a></br>", dr["NewsID"], dr["NewsTitle"]) });
                }
            }
        }