无法从sqlserver显示base64图像数据HTmlEditor控件? [英] Can't display base64 image data HTmlEditor controls from sqlserver ?

查看:97
本文介绍了无法从sqlserver显示base64图像数据HTmlEditor控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





现在我在asp.net中使用了HTml编辑器控件然后我在控件中复制了粘贴图像,然后在点击提交按钮后将其存储在sqlserver中的表。



但是当我尝试在gridview中显示图像数据时,无法在gridview中显示iamge。



Ex:

< cc1:编辑ID =   edQuestions runat =   server宽度=   92% AutoFocus =   false 
可见= true高度= 200px IgnoreTab = True /&g t;





这里存储的数据在sqlserver的单列中:



< img alt =src =data:image / png; base64,iVBORw0KGgoAAAANSUhEUgAAAOsAAAB6CAIAAADRUjNkAAAXFklEQVR4nO2d VNa2bbH / ddSdVOdup0Y4QgOvOqKVddnPbtS19y />这是测试



gridview中的显示格式,但不能显示图像

<% #Eval(问题)%>



请有人知道告诉我。

谢谢

解决方案

图像保存到数据库的格式是什么?就像将图像转换为字节并保存/只是图像路径保存到数据库一样。您可以通过一种或另一种方式查看此示例让你的问题得到解决



在代码项目网站中回答相同的问题



如何在gridview中显示sql表中的图像? [ ^ ]



显示SQ L Image MVC [ ^ ]

Hi,

Now I have used HTml Editor controls in asp.net then I copy paste image with text in controls then After Click submit button it is stored in table in sqlserver.

But when i try to display data in gridview with image data, Can't display iamge in gridview.

Ex:

<cc1:Editor ID="edQuestions" runat="server" Width="92%" AutoFocus="false"
                                        Visible="true" Height="200px" IgnoreTab="True"/>



Here stored data in single column in sqlserver:

" <img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOsAAAB6CAIAAADRUjNkAAAXFklEQVR4nO2d VNa2bbH/ddSdVOdup0Y4QgOvOqKVddnPbtS19y/> this is the test "

Display format in gridview, but can't diplay image
<%# Eval("Questions") %>

Please anybody knows tell me.
Thanks

解决方案

What is the format the image is saved to data base? like you converting image to byte and saving/ just image path is saving to database. one or the other way you can look in to this example and get your issue solved

same issue been answered in Code project Site

how to display image from sql table in gridview?[^]

Display SQL Image MVC[^]


这篇关于无法从sqlserver显示base64图像数据HTmlEditor控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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