如何使用razor引擎访问mvc中相同视图中的检索和显示数据? [英] How to access retrieve and display data in the same view in mvc using razor engine?

查看:96
本文介绍了如何使用razor引擎访问mvc中相同视图中的检索和显示数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用复选框保存数据。我已将该数据传递给模型。我不知道如何在同一视图中检索已保存的数据。

I am using the check box to save the data.I have passed that data to the model.And I didn't know how to retrieve the saved data in the same view.

推荐答案

访问模型数据来自使用Razor的视图中的控制器 [ ^ ]



请点击此处。这只是一个关于使用Razor访问数据的一些教程。请发布您的代码。或者您想要在网格或编辑器或文本框中显示数据。

如果您有任何疑问,请回复您的评论。

谢谢

:)

根据您的需要,您需要做的是,

获取被点击的名称或行的ID(当你已经使用了列表)并且名字的onclick对服务器进行ajax调用以获得该用户的待检查值,并且在ajax成功时,使该名称的复选框处于活动状态/已检查状态。我希望你知道怎么做!!
Access Model Data from Controller in View Using Razor[^]

Please check here. This is just a tutorial to give some idea regarding the accessing data using Razor. Please post your code. Or what you want to show the data like in grid or editor or in a textbox.
Please post back your comments if you have any queries.
Thanks
:)
According to your need, what you need to do is,
Get the ID of the Name that is being clicked or the row(as you have used list) and onclick of the name make an ajax call to the server to get the To Be checked values for that user and on success of the ajax make the check box with that name to be active/checked. I hope you got an idea how to do !!


这篇关于如何使用razor引擎访问mvc中相同视图中的检索和显示数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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