Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在网格中保留组合框_C#_Asp.net - Fatal编程技术网

C# 在网格中保留组合框

C# 在网格中保留组合框,c#,asp.net,C#,Asp.net,我在网格中有一个组合框。基本上,为了得到它,我必须使用findcontrol 不过,我正在考虑另一种选择。在init方法中,我计划获取值并将其存储到私有静态字段: private static RadComboBox theComboBox 有人能告诉我这不是一个好的做法吗。将这样一个相对复杂的对象存储在静态字段中是否不明智?我不建议这样做。看看这个问题的答案。如果你真的想这样做,我会使用会话来代替

我在网格中有一个组合框。基本上,为了得到它,我必须使用findcontrol

不过,我正在考虑另一种选择。在init方法中,我计划获取值并将其存储到私有静态字段:

private static RadComboBox theComboBox

有人能告诉我这不是一个好的做法吗。将这样一个相对复杂的对象存储在静态字段中是否不明智?

我不建议这样做。看看这个问题的答案。如果你真的想这样做,我会使用会话来代替