值不能为null或为空。参数名称:elementID [英] Value cannot be null or empty. Parameter name: elementID

查看:677
本文介绍了值不能为null或为空。参数名称:elementID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我在.aspx页面上放置了一个Html编辑器,当我正在运行时,我开始使用

异常详细信息: System.ArgumentException:Value不能为null或为空。

参数名称:elementID错误。



如果有任何身体有任何想法请求帮助我解决这个错误。

我们非常感谢您的帮助。

Hi Friends,

I am placed a Html Editor on .aspx page and when i Running i am gettin
Exception Details: System.ArgumentException: Value cannot be null or empty.
Parameter name: elementID Error.

Pleas help me if any body have any Idea to sort out this error.
Your Help will be highly appreciate.

推荐答案

您需要显示特定解决方案的代码。但是,当将无效值传递给方法参数时,通常会生成此异常。我相信,与你的aspx中的html编辑器没有任何关系。检查你的方法一个null或空是传递它不应该的地方。



尝试做一些防御性编程以避免这些类型的错误。在适当的地方检查空值总是更好。



您可以查看合同设计可以成为这类问题的安全防范的概念。
You need to show your code for specific solution. But this exception normally comes generated when an invalid value is passed to a method argument. I believe, there is no relation with having a html editor in your aspx with this error. check your methods a null or empty is being passed where it should not be.

Try to do some defensive programming to avoid these type of errors. It is always better to check for nulls where appropriate.

You may look into "Design by Contract" concept which can be a safe guard for this type of issues.


当我遇到同样的问题时,我吸了2小时,最后我发现我的代码中有一个第三方控件OBOUT,删除后一切正常
When i got this same problem i sucked on this 2 hour and finaly i found one third party control"OBOUT" was there inside my code, after removed it everything is ok


请使用此代码

Please use this code
   <cc1:editor id="ajxEditor" width="50%" runat="server" activemode="Design" autofocus="true" clientidmode="AutoID" xmlns:cc1="#unknown" />

ClientIDMode="AutoID"


Thanks
Nayeem Mansoori.


这篇关于值不能为null或为空。参数名称:elementID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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