验证无效案例ID [英] validation for invalid case id's

查看:85
本文介绍了验证无效案例ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的aspx页面上具有多行文本框,我正在更新多个案例ID的案例状态.例如,案例ID(如1508,1509)有效,但有效案例ID的无效案例ID(如1508,1509,1111111).因为11111111是有效的案例ID,所以仅成功更新该案例ID的验证如何有效.

Having multiline textbox on my aspx page through that i am update case status of multiple case id. e.g case id like 1508,1509 are valid but with valid case id having invalid case id like 1508,1509,1111111. in that 11111111 is in valid case id so how so validation for that case id only & other are update successfully.

推荐答案

您怎么知道什么是有效数字?使用 CustomValidator [
How do you know what are valid numbers? Use a CustomValidator[^] and implement that logic.


嗨@ravijain

您可以为此使用自定义服务器端验证.
获取caseId的集合或数组
在该页面上执行以下任务

将caseid拆分(如果不使用,")

处理它们并过滤有效和无效的
我正在为您提供此示例代码

假设案例ID是这样的(包含无效且无效)

Hi @ravijain

You can use the custom server side validation for this.
take the collection or the array of caseId''s
perform following task on that

make the caseid splited(if you are not using ",")

process them and filter which are valid and which are invalid,
i am giving you sample codee for this

assume the case id''s are like this(contains valisd and invalid)

101,102,1022,102235,40555
i=0,i=1,i=2, i=3,   i=4
string validCaseID
for(int i;i<yourarrayitem.count;i++)>
{
if(functioncheckvalidcaseIdornot(yourarrayITEM[i]))
{
if(validCaseID="")
validCaseID=validCaseID+yourarrayITEM[i];
}
else
validCaseID=validCaseID+","+yourarrayITEM[i];
}

,您将获得所有有效ID作为字符串(,"分隔),然后在那里更新状态,因为您希望成功更新有效caseid的状态,而不是更新无效case ID的状态的


希望对您有帮助

谢谢

and you will get all the valid ID''s as string("," seprated) then update there staus as you want status update successfully for the valid caseid''s and not updated for the invalid case id''s


Hope it will help you

Thanks


这篇关于验证无效案例ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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