首页 新闻 会员 周边

请指点,关于System.Web.HttpContext.Current.Response.Write的问题

0
悬赏园豆:20 [已关闭问题] 关闭于 2012-05-11 14:57

为什么我在类中用System.Web.HttpContext.Current.Response.Write("内容")输出信息时输出不了呢? 数据读取正常,我想要看看方法里参数的最终值都是什么,结果用System.Web.HttpContext.Current.Response.Write输出调试信息页面什么都不显示;

请指点一下啊,谢谢:

这是调用方法的页面代码:

System.Collections.Generic.IList<Smartsite.News.Model.InfoInfo> list
= Smartsite.News.BLL.Info.GetData(ref intAll, key, CategoryID.ToString(), 1, CategoryLevelid.ToString() ,
        "1", "", "", PSIZE, intCurPage, false);     

        
这是类文件定义方法代码:

 public IList<InfoInfo> GetData(ref int RecordCount, string newKey, string categoryID, string tempState, string createDatef, string createDates, int pageSize, int pageIndex, bool bAdmin)
{
    System.Web.HttpContext.Current.Response.Write("newKey:" + newKey + "<br/>categoryID:" + categoryID + "<br/>tempState:" + tempState + "<br/>createDatef:" + createDates + "<br/>pageSize:" + pageSize + "<br/>pageIndex:" + pageIndex + "<br/>bAdmin:" + bAdmin);
    System.Web.HttpContext.Current.Response.End();
    IList<InfoInfo> al = new List<InfoInfo>();
    GetDataDb(newKey, categoryID, tempState, createDatef, createDates, pageSize, pageIndex, bAdmin);
    using (IDataReader reader = ExcuteCmd())
    {
        while (reader.Read())
        {
            al.Add(GetByReader(reader));
        }
        if (reader.NextResult())
        {
            while (reader.Read())
            {
                RecordCount = int.Parse(reader["recordcount"].ToString());
            }
        }
    }
    return al;
}


这是类库的结构,方法是在数据层的Info.cs中定义的:

 

我所知道的就是System.Web.HttpContext.Current.Response.Write是针对用户的单次请求输出数据的,放在类里面平常可以输出想要的数据,但这次不知道为什么就不行了,有知道的朋友请指点下,谢谢。

skybirdzw的主页 skybirdzw | 初学一级 | 园豆:3
提问于:2012-05-11 14:22
< >
分享
所有回答(1)
0

你的代码是没问题,你检查下,确认已经调用了这个方法。感觉你可能没调用到这个方法,或者你访问的页面不对。

无之无 | 园豆:5095 (大侠五级) | 2012-05-11 15:40
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册