从视图动态加载值到控制器 [英] load the values dynamically from view to the controller

查看:50
本文介绍了从视图动态加载值到控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用MVC3.
为此,我想从数据库动态加载图像
在视图中,我使用了图像标签,例如:


I am using MVC3.
I want to load the image dynamically from the database,for that
In the view i used the image tag like:

<img src="@Url.Action("GetImage/${ID}", "Home")"  alt = "${name} image" />


在url操作中,如果我传递诸如"GetImage/1"之类的静态数据,则它正在显示与ID = 1图像相对应的图像.但是如果我动态传递,则它不会反映给控制器.
您能否建议我如何将该值动态传递给控制器​​..


In the url action if i pass the static data like "GetImage/1" then it is displaying image corresponding to the ID = 1 image.but where as if i pass dynamically then it is not reflecting to the controller.
can u suggest me how to pass this value dynamically to the controller..

推荐答案

{ID}," Home)" alt ="
{ID}", "Home")" alt = "


{name}图片"/>
{name} image" />


在url操作中,如果我传递诸如"GetImage/1"之类的静态数据,则它正在显示与ID = 1图像相对应的图像.但是如果我动态传递,则它不会反映给控制器.
您能建议我如何将该值动态传递给控制器​​吗?.


In the url action if i pass the static data like "GetImage/1" then it is displaying image corresponding to the ID = 1 image.but where as if i pass dynamically then it is not reflecting to the controller.
can u suggest me how to pass this value dynamically to the controller..


请指定图像的正确校正路径...
please specifiy coorrect path of image...


这篇关于从视图动态加载值到控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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