最近两周我没有得到正确的解决方案... [英] i'm not getting correct solution from last 2 weeks...

查看:76
本文介绍了最近两周我没有得到正确的解决方案...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用组合框没有下拉菜单.
我的问题很简单,
我在内容页面中将debuggimg作为用户代码未处理的异常"时收到错误消息.
我想通过显示警告消息为"SELECT COMBOBOX BEFORE SUBMIT BUTTON"来退出其余代码以对该异常执行.

i''m using combobox not dropdown.
my problem is so simple to tell,
im getting error message while debuggimg as ''unhandelled exception by user code'' in content page.
i want to exit from the remaining code to execute on that exception,by showing an alert message as ''SELECT COMBOBOX BEFORE SUBMIT BUTTON''.

推荐答案

有两个处理方法:
1)在代码周围放置一个try ... catch块,并在catch块中显示您的警报.
2)通过在导致错误之前进行检查,使用调试器来准确找出产生异常的原因并进行修复.由于调试器正在捕获异常,因此从代码中应该可以明显看出是什么原因造成的.

我本人会做第二种选择:异常不应该用作处理的正常部分:当我们做错了什么而不是用户做错了的时候,它们就可以让我们知道!

没有相关的代码片段,我无法帮助您解决引发异常的实际问题...
There are two ways to handle this:
1) Put a try...catchblock around the code, and display your alert in the catch block.
2) Use the debugger to find out exactly what is generating the exception and fixing it, by checking before you cause the error. Since you have the debugger catching the exception, it should be obvious from your code what is causing this.

Myself, I would do option two: Exceptions should not be used as a normal part of processing: they are there to let us know when we have done something wrong, not the user!

Without a relevant code fragment, I cannot help you fix the actual problem throwing the exception...


我真的认为您应该在添加更多代码之前尝试解决该错误. 只是一个猜测-似乎在将数据加载到组合框之前向组合框分配了一个值.
I really think you should try solving the error before putting in more code.
Just a guess - looks like the combo box is being assigned a value before data has been loaded into it.


这篇关于最近两周我没有得到正确的解决方案...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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