图像上传并在MVC3中显示 [英] Image upload and display in MVC3

查看:101
本文介绍了图像上传并在MVC3中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ASP .NET mvc3.i的全新用户,我有一个产品表和3列-productid int,名称为varchar(50)和linktofile varchar(50).我想将图片位置保存在linktofile列中.我该怎么办?当我要显示产品时,我想查看产品ID,名称和图片.任何人都可以帮助我.我使用razor

Hi, i am totally new in asp .net mvc3.i have a product table and 3 column - productid int,name varchar(50) and linktofile varchar(50). i want to save picture location in linktofile column.how can i do that and when i want to display product then i want to see product id,name and picture.any one can help me. i use razor

推荐答案

您的问题很大.我认为没有人会花时间创建一个项目,将其上传到某个地方并给您链接!因此,请按照以下步骤操作:

1.浏览 http://www.asp.net/mvc [ http://www.asp.net/mvc/tutorials/older-versions/movie-database/create-a-movie-database-application-in-15分钟- with-asp-net-mvc-cs [ http://msdn.microsoft.com /en-us/library/ms524632(v=vs.90).aspx [
Your question is vast. I don''t think anybody will have the time to create a project, upload it somewhere and give a link to you! So, follow these steps:

1. Go through the tutorials in http://www.asp.net/mvc[^]

2. Then go through this link - http://www.asp.net/mvc/tutorials/older-versions/movie-database/create-a-movie-database-application-in-15-minutes-with-asp-net-mvc-cs[^].

3. Then go through this link - http://msdn.microsoft.com/en-us/library/ms524632(v=vs.90).aspx[^]

All of these 3 links should help you get started and create an application that meets your requirements!


谢谢您的建议.我发现已经有人创建了该项目并为我提供了解决方案.总是在网上找到解决方案,因为这是非常普遍的问题.我在努力设置路径,因为我没有将图像保存在数据库中,只是保存链接路径以及如何在视图中返回它.这不简单!
Thanks your suggestion.i find some one already create the project and give the solution for me.you always find solution on net because this is very common problem. i was struggling how to set path because i dont save image on data base just save link path and how to return it in view . is it not simple!


这篇关于图像上传并在MVC3中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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