如何在asp.net和c#中上传和显示图像? [英] how to upload and display image in asp.net and c#?
本文介绍了如何在asp.net和c#中上传和显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我点击更改按钮时,我想上传照片,然后上传的照片显示在img栏上...任何人都帮我..
< div class = af-pf-imfg > < img src = images / pt.png id = imgDisplay width = 16 0 height = 180 alt = / > < / div >
<% - < div class = af-pf-imfg2 onclick = < span class =code-string> uploadStarted(); style = cursor:pointer;>更改照片< / 格跨度> > - %>
< 输入 < span class =code-attribute> class = af-pf-imfg2 type = file value = kerala style = width:85px; margin-left:65px ; cursor:pointer; / > ;
解决方案
找到一篇文章来实现这一点。它使用Asp.Net C#MVC 3,4 Razor。它可以指导你完成你所取得的成就:
http://www.askamoeba.com/Opensource/Opensourcedetail/132/Crop-Resize-Upload-Images-in-C-MVC3-MVC4-using-Jquery-剃刀 [ ^ ]
这些链接一定会对您有所帮助:
http://www.c- sharpcorner.com/uploadfile/0c1bb2/uploading-images-to-database-using-asp-net-c-sharp/ [ ^ ]
http://www.c-sharpcorner.com/UploadFile/0c1bb2/uploading-and-displaying-images-from- database-using-Asp-Net / [ ^ ]
http://www.c-sharpcorner.com/uploadfile/prathore/multiple-image-upload-in-Asp-Net/ [ ^ ]
when i click the change button i wanted to upload a photo then the uploaded photo display on the img column...any one help me..
<div class="af-pf-imfg"><img src="images/pt.png" id="imgDisplay" width="160" height="180" alt="" /></div>
<%--<div class="af-pf-imfg2" onclick="uploadStarted();" style="cursor:pointer;">Change Photo</div>--%>
<input class="af-pf-imfg2" type="file" value="kerala" style=" width:85px; margin-left:65px; cursor: pointer;" />
解决方案
Found an article to implement this. It uses Asp.Net C# MVC 3,4 Razor. May it'll guide you through what you are achieving :
http://www.askamoeba.com/Opensource/Opensourcedetail/132/Crop-Resize-Upload-Images-in-C-MVC3-MVC4-using-Jquery-Razor[^]
These links will definitely help you:
http://www.c-sharpcorner.com/uploadfile/0c1bb2/uploading-images-to-database-using-asp-net-c-sharp/[^]
http://www.c-sharpcorner.com/UploadFile/0c1bb2/uploading-and-displaying-images-from-database-using-Asp-Net/[^]
http://www.c-sharpcorner.com/uploadfile/prathore/multiple-image-upload-in-Asp-Net/[^]
这篇关于如何在asp.net和c#中上传和显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文