如何获取存储在ViewData中的数据 [英] how to get data stored in ViewData

查看:329
本文介绍了如何获取存储在ViewData中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,
plz帮助我成为mvc的新手

我在控制器中有两种方法
第一个是ActionResult方法来显示视图
在此视图中,我正在使用第二种方法显示一个网格,该方法返回网格数据

现在正在使用jsonresult方法在ViewData中存储一些数据

我的问题是我无法访问视图(在.aspx页中)的ViewData中存储的数据
在脚本中也无法访问


在此先感谢

Hi friends ,
plz help me am new to mvc

I have two methods in controller
first one is ActionResult method to display the view
in this view i am disaplying one grid using the second method which returns the grid data

now am stroring some data in ViewData in this jsonresult method

my problem is i am unable to access the data stored in ViewData in view(in .aspx page)
in script also am unable to access


Thanks in advance

推荐答案

您能否提供您的源文件
代码来调试您的问题
can you provide your source
code for me to debug your problem


这篇关于如何获取存储在ViewData中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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