This is a migrated thread and some comments may be shown as answers.

Problems integrating Binary Image into Sharepoint webpart

1 Answer 51 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Ross
Top achievements
Rank 1
Ross asked on 25 Sep 2010, 10:14 AM
Hello,

I am new to Telerik controls and here is my first issue.

There is a WSI service that provides a JPG image as byte[] array. The image can be easily saved to the file as following:

FileStream fs = new FileStream(fullPath, FileMode.Create);
fs.Write(picture_aray, 0, picture.Length);
fs.Flush();
fs.Close();

Now, i am trying to use RadBinaryImage control and its DataValue property:

EmployeePhoto.DataValue = picture_array;

The result is rendered as an empty image.

<img style="height: 340px; width: 344px;" src="../Telerik.Web.UI.WebResource.axd?imgid=11b68653b19b407494f577727fdb969d&amp;type=rbi" id="ctl00_m_g_f2e35c4b_5688_4365_852b_d3bfe094880d_ctl00_EmployeePhoto">

As you see, dimensions of image are correctly set, so there is no problem with byte[] data. Instead there is something wrong with handlers.

I edited web.config file for sharepoint to include
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
in System.webServer - > Handlers.

But this did not help. Any ideas?

1 Answer, 1 is accepted

Sort by
0
Ross
Top achievements
Rank 1
answered on 25 Sep 2010, 11:18 AM
.. And after some investigation i changed web.config
to

<system.WebServer>
<handlers>
....
<add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2010.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
</handlers>
</system.WebServer>

and now it works.

So, why it does not work just with
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" /> without directly specifying assembly?

I found out that .msi adds several SafeContols to web.config:
<SafeControl Assembly="Telerik.Web.UI, Version=2010.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TypeName="*" Safe="True" SafeAgainstScript="False" />
<SafeControl Assembly="Telerik.Web.UI, Version=2010.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI.Editor" TypeName="*" Safe="True" SafeAgainstScript="False" />
<
SafeControl Assembly="Telerik.Web.UI, Version=2010.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI.Widgets" TypeName="*" Safe="True" SafeAgainstScript="False" />
<
SafeControl Assembly="Telerik.Web.UI, Version=2010.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.Design" TypeName="*" Safe="True" SafeAgainstScript="False" />
<
SafeControl Assembly="RadEditorSharePoint, Version=6.0.0.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint" TypeName="*" Safe="True" SafeAgainstScript="False" />
<
SafeControl Assembly="RadEditorSharePoint, Version=6.0.0.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint.FieldEditor" TypeName="*" Safe="True" SafeAgainstScript="False" />
<
SafeControl Assembly="RadEditorSharePoint, Version=6.0.0.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint.ListFieldEditor" TypeName="*" Safe="True" SafeAgainstScript="False" />
<
SafeControl Assembly="Telerik.Ajax.SharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aa9e5f693af67c7b" Namespace="Telerik.Ajax.SharePoint" TypeName="*" Safe="True" SafeAgainstScript="False" />


Does it have any relation to httpHandler not able to find its type?
Tags
BinaryImage
Asked by
Ross
Top achievements
Rank 1
Answers by
Ross
Top achievements
Rank 1
Share this question
or