Images/Imagebuttons in SharePoint sandboxed Webpart - visual-studio-2010

New to developing for Sharepoint Online but I'm familiar with how to deploy/package web parts to both local Sharepoint and Sharepoint Online.
Trying to create a basic webpart that contains numerous image links or image buttons to run various links to different libraries and functions. The webpart will activate fine but what I'm struggling with is getting the images to display once deplyed to Sharepoint Online.
If I include the image in the web part solution and deploy it to the local Sharepoint, the image displays correctly but when packaged and uploaded the image won't display. I've googled a fair bit and tried different ways of adding the image as embedded resources in the Web Part package .wsp but none seem to work.
I know I can only make the web part in sandboxed form for use with Sharepoint online, so I can map to the Sharepoint images folder, and really need the image/icon files to be packaged with the .wsp.
Do i need to include the image files in a specific location within the solution for them to be packaged and referenced?

You need to add the images through a module
Url can be any document library.
<Module Name="Pics" Url="PathToDocLib">
<File Path="yourPicture.png" Url="Pics/yourPicture.png" />
</Module>

Related

Loading PCL sourced HTML page in Cross Browser project (Xamarin)

I am using Xamarin to support
Android
iOS
Windows 8.1
WPF
I can create a PCL project that each of those platforms can see from their platform specific project.
What I want to be able to do is host a HTML page and associated javascript files in the PCL.
All the examples I have seen for loading Local Html files are when there is a copy of the HTML in each platform specific project. I don't want 4 copies of the HTML I want one copy in the PCL.
Can this be done?
We tried to do the same thing a few months ago and as far as I remember we couldn't. The solution for us to make it work was downloading (or extracting in your case) html files to the local directory for each platform using PCLStorage nuget and load directly from local path with custom renderers.
We used custom renderers for each platform for WebView instead of crossx webview. One thing to note that instead of using UIWebView you must use WKWebView if you're targeting iOS9+.
Simply pass your main directory of html files to each renderer and try native controls to use local content. Unfortunately xamarin's crossx WebView does not provide flexible actions when it comes to local content.

How to share image files across projects in one solution in visual studio 2012?

I have a solution with multiple projects in it.
And I have lots of pictures which two or three projects would need them.
How can I add these images once and share them across all the projects in the solution?
Really depends on what you want.
You could use linked files.
To do so simply have one "common" project with the resources and in the second project you use "Add Existing Item", before you click add, click the small arrow right to the button and say "linked file". This will not copy the file but keeps it in the current location. But it will treed it as if it is a normal project file...
If you just need static content shared across multiple web sites,
a) have one web site storing the static content and reference all URLs to link to that static content web site.
b) If you don't want to host a separated web site for the static content, simply create a sub website within each main web site...
If you have static content, create a virtual directory within your web site linking to a folder with all your static content.
Write a dll to hold all the resources and make them public, or my preference would be to add some methods to the dll to access named resources, e.g. public Stream GetImage("logo"), then reference it from your other projects.
Would be a couple of ways.

Images not loading through CSS on IIS7.5 MVC4

My web app(MVC4) is hosted on IIS 7.5, Windows 7 Ultimate with .net framework 4.0 and 4.5 installed. On hosting the application, the images are not rendered, giving me a 404 error
The content type is "Text/html" shouldn't it show as "image/jpeg or png"?
On giving the image path directly, the image is rendered, but not through css. The css is loading, as my layout is intact.
I have gone through many questions related to the same issue, have included
<modules runAllManagedModulesForAllRequests="true" />
checked for Static Content under IIS>WWW Services in
control Panel, applied hotfixes (http://support.microsoft.com/kb/980368).. in vain.
My css code is as below,
body{background:url(images/bg.jpg);
image folder structure is
ABC
images (folder)
bg.jpg
main.css
(have tried giving the image path along with .. and /, no use)
ExtensionlessUrlHandler, are present in the webconfig, hosted on .net framework 4.0 (integrated),
My IIS also co-hosts MVC3 application, which runs fine.
Not sure what is the issue? I am missing something, which hasn't been tried yet, your help would give me some sleep.
Update:
Refering to this post
I changed the bundle according to the answer by Calgary Coder, the image is loading now.
As per this post,
I changed my bundle (as per below format/pattern)
bundles.Add(new StyleBundle("~/Content/css/jquery-ui/bundle")
.Include("~/Content/css/jquery-ui/*.css"));
And the images are loading now. Thanks to Calgary Coder.

ASPx template to produce html as well as PDF in Windows Azure

I have a project requirement to produce PDF files as well as HTML on a solution deployed on MS Windows Azure. The PDF files are often printed and delivered to clients as part of a presentation as and also made available through a client portal. Users of the client portal should also be able to interact with the information in a more interactive way via html. So here’s my question, are there ASPx controls that allow the information to be rendered in html or pdf that run on an Azure server?
You could just create an HTML solution and convert each page to PDF when needed. There are several tools that can help you with this:
wkhtmltopdf (LGPL, command
line applicacion)
Amyuni WebkitPDF, a HTML to PDF/XAML conversion library (free
for commercial and non-commercial use, Windows library with C#
bindings)

Why is Configuration message appearing on jpeg images exported from DICOM file?

I am trying to make a web based dicom image viewer. I am using c# and asp.net. I am using Clear Canvas libraries found on www.clearcanvas.ca. The problem here is that when I try to export the jpeg images from dicom files the following message appears on them:
"The current configuration system does not support user-scoped setting"
On other forums I have found that this error can be removed by the application scope settings. I have tried that and still the message appears on the images. I have even shifted the user settings in app.config file to applicationsettings sections. Since web based solutions do not support user settings because the website has to run on the server. If some one has done this and removed this message from the images, then please share it here. I would really appreciate some help on removing this error. Thanks.
The ClearCanvas ImageViewer components were written to using several User settings. IIS based applications do not support user settings. An exception is occurring within the assembly due to the lack of support for user settings and placing it on the image.
There's a couple of solutions. You could go and modify the code by changing all of the settings to be application settings instead of user settings. You could also create a new .NET settings provider that supports user settings that could be used within IIS.

Resources