English 中文(简体)
防止重新流行的观测数据
原标题:prevent repopulating viewdata

收集了“观点”,是否可使用从控制器内多种行动方法收集的这种观点,而无需重新加以使用?

最佳回答

不适用。 只是控制者行动与观点之间的临时共同储存。 这使控制者能够采纳某种模式。 从设计角度看,<代码>ViewData不应由控制人行动读,只应写。

如果你希望将物体储存在多项请求或<代码>TempData(内部使用会议)之间,则你可以使用<代码><>>>>>>>>><>/代码>物体。

问题回答

是的,如果你将数据储存在电话之间(例如会议或某种藏匿点)的某种持久性储存中,你可以这样做。 虽然我不建议,有时对各地需要的长期生活数据而言,这种做法是必要的,而且往往不会改变。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签