我可以在If条件下使用View State吗? [英] Can I Use View State In If Condition?

查看:74
本文介绍了我可以在If条件下使用View State吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的申请是针对休假模块。现在,在我使用的情况下,员工可以正常申请休假,休假和带薪休假。但是现在我必须设置条件,如果总休假天数(Count)小于或等于2那么它将自动进入CL n PL将在下拉列表中不可见。那么我能做些什么?

My application is for Leave Module. now in that i used, employee can apply leave normally Seek Leave, Casual Leave and Paid leave. but Now i have to put condition like if total leave days(Count) is less than or equal to 2 then it will automatically goes in CL n PL will be invisible in drop down list. so what can i do for that?

推荐答案

要做到这一点,你必须接受关注点分离或者想法的想法正交性有布尔表达式和条件。当您使用它们时,在布尔表达式和条件语句中使用对象的位置并不重要。有观点状态。当您编写视图状态变量或读取它们时,使用这些变量并不重要。换句话说,分离并征服



任何 serializeable 对象都可以用作视图状态变量。使用视图状态变量很容易。请参阅,例如: http://asp.net-tutorials.com/state/viewstate [ ^ ]。



另请参阅: http://msdn.microsoft.com /en-us/library/z1hkazw7%28v=vs.100%29.aspx [ ^ ]。



我相信你知道如何写条件(if,if-else)陈述。



-SA
To do that, you have to embrace the idea of separation of concerns, or the idea of orthogonality. There are Boolean expressions and condition. When you use them, it doesn't matter where did you get objects used in Boolean expressions and conditional statements. There are view states. When you write view state variables or read them, it doesn't matter how you use those variables. In other words, separate and conquer.

Any serializeable object can be uses as a view state variable. Working with view state variables is easy enough. Please see, for example: http://asp.net-tutorials.com/state/viewstate[^].

See also: http://msdn.microsoft.com/en-us/library/z1hkazw7%28v=vs.100%29.aspx[^].

And I trust you know how to write conditional (if, if-else) statements.

—SA


这篇关于我可以在If条件下使用View State吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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