使用Cookie值加载gridview [英] Load gridview using a cookie value

查看:97
本文介绍了使用Cookie值加载gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种方法可以根据Cookie中的值来加载gridview.
现在它没有加载.请帮我这个饼干

I have a method to load a gridview according to a value inside a Cookie.
Now its not loading. Please help me with this cookie

Response.Cookies["selectedDateCookie"].Value = DatePicker.Text;
        Response.Cookies["selectedDateCookie"].Expires = DateTime.Now.AddMinutes(10);
        string selectedDate = Response.Cookies["selectedDateCookie"].Value;
        DataTable  dTable = new DataTable();
        systemBusinessLayer = new BusinessLayer();
        dTable = systemBusinessLayer.GetAllAppointmentsForToday(selectedDate);
        grvViewAppointments.DataSource = dTable;
        grvViewAppointments.DataBind();

推荐答案

U可以做一件事,首先检查cookie为null或不使用if条件,然后将cookie值分配给一些变量,然后像您在编码中一样传递变量,
U can do one thing, first check where cookie is null or not using if condition, then assign cookie value to some variable,and then pass the variable as u have done in coding,


这篇关于使用Cookie值加载gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆