如何设置Fileupload控件应该允许null [英] how to set Fileupload control sholud allow null

查看:125
本文介绍了如何设置Fileupload控件应该允许null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有用于浏览图像的文件上传控件,还有用于浏览搜索图像的另外5个文件上传控件.我已将其存储在数据库中.以表格的形式,我在产品图片中输入图片,如果没有必要,则意味着允许另外5个搜索图片. null(为空).

有可能吗?我该怎么做?

有人可以向我解释吗?

Hi,

I have file upload control to browse a image and another 5 file upload controls to browse search images.i have stored that in database.in form i am entering the images in product image and if os not necessary means the another 5 search images are allow null(that is empty).

Is it possible?How can i do this?

Can anyone explain me?

推荐答案

问题尚不清楚,但是首先,您需要了解 null和empty是绝对不同的东西支持空"概念的所有对象.这是因为null与引用(或非托管内存中的指针)相关,并且指示无指向".在.NET中,它适用于引用类型的对象,这些对象都由对对象的引用和引用所引用的对象本身"组成.当变量或成员为null时,此对象本身"部分不存在.相反,当一个对象为空"时,它永远不会为null.如果它是null,则将操作添加到空容器"的操作将是不可能的,并且将引发异常.例如:空字符串不是null,空列表不是null,等等.

—SA
The question is not clear, but to start with, you need to understand that null and empty are absolutely different things for all the objects which support the concept of "empty". This is because null is related to references (or pointers in the world of non-managed memory) and indicates "pointing to nothing". In .NET, it''s applicable to objects of reference type which all consist of reference to an object and "object itself" referenced by a reference. When a variable or member is null, this "object itself" part does not exist. In contrast, when an object is "empty", it is never null. If it was null, an operation of adding anything to an empty "container" would be impossible and would throw an exception. Examples: empty string is not null, empty list is not null, etc.

—SA


这篇关于如何设置Fileupload控件应该允许null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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