检查是否viewstate变量 [英] checking whether viewstate variable

查看:89
本文介绍了检查是否viewstate变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含数据表的viewstate变量,如何使用
检查它是否包含任何数据?
Viewstate("datatable")= nothing,给出错误

I have an viewstate variable containing a datatable, how can i check whether it contain any data or not, as using

Viewstate("datatable")=nothing , is giving an error

推荐答案

Try
if (viewstate("datatable") is nothing)
Try
if (viewstate("datatable") is nothing)


亲爱的朋友,

如果VIewState("Test")为空,则将错误,因为没有实例化值来调用实例方法.

如果ViewState("Test")是string.empty,则这是一个有效的字符串值,但为空(虽然不是null).

然后尝试通过
Dear Friend,

If VIewState("Test") is nothing, then this will error because there is no instantiated value to call an instance method.

If ViewState("Test") is string.empty, then this is a valid string value, but empty (not null though).

Then try to check this by
if (ViewState("Test").Equals("")) then


进行检查
希望对您有所帮助.

谢谢



I hope this will help you out.

Thanks


这篇关于检查是否viewstate变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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