C# - Display File Type Icon In Silverlight?

Mar 29, 2011

I have this situation where I need to display a bunch of files pulled from a Sharepoint site in a Silverlight application. I use a WCF service to get the data from the Sharepoint site.

So what I have is file names with their corresponding extensions. What I need to do is, display the files in the Silverlight application with their corresponding file type icon and file name. The following is the Heirarchical data template I use to display the files in the Silverlight application.

<sdk:HierarchicalDataTemplate x:Key="FileTemplate">
<StackPanel Orientation="Vertical">
<Image x:Name="imgFile" Source="{Binding FileImage}" Height="35" ></Image>
<TextBlock x:Name="txtFile" Text="{Binding FileName}"></TextBlock>
</StackPanel>
</sdk:HierarchicalDataTemplate>

Where FileImage and FileName are strings.

PS: The reason I don't have file type and size is because I using Sharepoint web services and XMLReader to get the information about the files.

View 1 Replies


Similar Messages:

C# - Display Icon With Respective File

Jan 12, 2010

I have a gridview control which is displaying the files and directory names in one column. Now i want to display the file icon of that particular file in the other column... eg test.txt will have a different icon form image1.jpg and here.xsl i have found two examples but don't kno if they will work or not. [URL] or [URL]
how to incorporate this with my gridview..?

View 2 Replies

Web Forms :: How To Take Application Near Clock Icon,near Local Area Connection Icon In Running Mode

Jul 8, 2010

i am develpping a alarm application when user minimized this it should be minimized appear near the system clock,local area connection icon(as hidden icon).

View 3 Replies

Web Forms :: Icon For Browser Icon Shows Through Image On The Screen?

Feb 22, 2011

i assigning an imagebutton to an image url in css causes my image to still show, but also the icon for an image if there isn't an image. If I declare it in the html instead, it shows fine, only when I try to use CSS for the referene to the image url.I use the following syntax for the image in css

background-image: url(image1.jpg);

Again, it is finding and showing the image, but it is also showing the windows image icon.

View 2 Replies

C# - How To Display Size And Icon For Pdf And Word Docs

Oct 13, 2010

I have webpages that contain links to word documents and pdf files. For each link I want to display the file size and an icon showing what the file type is.

I'm thinking the best way to do this would be with CSS? Can anybody give me an example of how to do this?

View 1 Replies

Forms Data Controls :: Display An Icon In Gridview - Selectively?

Aug 24, 2010

I've created an ExpenseReport application which allows users to attach receipts to Expense Report Lineitems. These are contained in a gridview using a template field:

[Code]....

The trouble I have is that the 'attachment.jpg' icon shows for every lineitem (even one that does not contain an attachment). I would like to be able to selectively display this icon or show a different icon if there is NO attachment.

View 9 Replies

Forms Data Controls :: Display Image Icon In HyperLinkField Of Gridview?

Aug 30, 2010

how to display an image in a HyperLinkField of a gridview? Instead of words, I just want to show a simple little icon that can be clicked on and pass a query string to the next page. The first hyperlink field I have set up works perfectly and passes the querystring to the next page. The second hyperlinkfield is my attempt at showing the image but it's giving me a squiggly and telling me "the element img cannot be nested within the element hyperlinkfield" I got this technique from this brief article - I would like to accomplish exactly what it says it is suppose to do.

[Code]....

View 5 Replies

Display Last 100 Visitors To Website In Silverlight?

May 13, 2010

I am interesting on log down the recent 100 visitors around the world whom have visited to my website and display their country information and IP address on the website developed by Silverlight platform.

Where can I get accurate data for detecting the visitors' IP address and geo-location information?

View 2 Replies

Forms Data Controls :: Display An Icon Image In Gridview Depending On The Returned Data

Aug 13, 2010

I have a gridview and would like to display one of 5 icons depending on the value returned from the database for that row (simply just A, B, C, D or E). Which event in my datagrid should I be looking at to check what value I'm getting? I presume once I can check a value I can simply set an image source using if statements?

View 4 Replies

AJAX :: Accordian Inside Nested Gridview, Change "plus" Icon To "minus" Icon

Apr 9, 2010

Using ASP.Net/VB.Net 2005.

I have an accordian inside a nested gridview that is controlled by an imagebutton. The Imagebutton is a plus sign "+" and the expand/collapse functionality is working great.

What I need to do is when the user expands the accordian is to change the plus ("+") sign to a minus ("-") image. I am trying to do this with javascript but its not working.

View 2 Replies

Web Forms :: After Added Already Existing Project The Solution Icon Vanished By Showing The Icon Of Recently Added Project?

Feb 1, 2010

I have the following list of projects WebUI (WebSite) , DataAccess (ClassLibrary) , LogicLayer(ClassLibrary). Those of the project are purposively crated separately.But my scenario is, need to create only one solution file, then add all of the above projects under this solution file. So that i can be easiy interacted and changes can be made by opening solution file only instead of opening each project individually.

Simply all of the layer projects are under one roof means one solution. I tried it by adding solution first, then i added already existed project into this. But once after added already existing project the solution icon vanished by showing the icon of recently added project. By this way I could not add another project into this section too.Hope this is the way the basic real-time projects are created; to achieve the centralized control over architecture based projects.

View 4 Replies

C# - Improve Load Time For A Silverlight App Data Display?

Mar 9, 2011

the initial data load for the Silverlight app, can take 6 -20 seconds. We are using web service, data is coming from one database and loads 2 years worth of transactions. We don't use summary tables. we are not doing insert/update/delete, just display.

View 4 Replies

C# - Some Ways Of Parsing Doc Type And Pdf Type File?

Mar 2, 2011

I am creating an app in which i need to parse the documents uploaded by people, they can upload document either of the two types i.e. doc type or pdf type i want to know what are the various methods available to do that and which one is the best among them. iam creating the app in asp.net with c#

View 1 Replies

How To Display Icon IN Title Bar Of Browser With Title

Dec 9, 2010

How to Display Icon IN title bar of Browser with title?

View 7 Replies

C# - How To Add Silverlight XAP File To An Existing Webpage

Aug 26, 2010

I've added a new silverlight application to my project. It works fine by itself.

I even have a ClientBin folder in my ASP.NET Web Application with the XAP file of my Silverlight project.

So how I embed that Silverlight project into my existing ASP.NET web application?

View 1 Replies

Uploading File(s) To Webserver In Silverlight (C#)?

Jan 26, 2010

Alright, so i have a silverlight application,

it opens a filedialog, gets the selected file, transfers it to asp.net which saves it to the server, but i want to know how to implement a progress bar for it. for big files, and multiple file uploads, i will need to know the progress of the file upload to the server, is this possible?

View 1 Replies

C# - Silverlight 4 : Uploading File To Server?

Sep 15, 2010

Here is an easy one:I need a stable simple file uploader with a progress bar, I have found lots of fancy ones from the search. However, I need the community opinion on which ones to go with? Tutorial links would be appreciated.BOUNTY: I have a FileStream which I would like to upload to a server, below is a sample server server URL:string uploadUri;string SavedFileName = "testXRay.jpg"
uploadUri = @"http://localhost/MyApplication/Upload/Images/" + SavedFileName;I am adding a bounty in hope to get a working solution which I could use from my SL application. MyApplication is hosted in IIS.

View 3 Replies

VS 2010 - Reading Local File With Silverlight?

Mar 29, 2011

it may not have to do with silverlight as such, but a "security" issue. I appologize if that was wrong.

I´m having a go at silverlight...

I want to display large amount of data in good looking charts. Ideally, I would use a web service. However none of the tutorials I´ve watched works. There´s always some component or class missing.

So I figured I´d do it the "ugly" way, creating a xml file from a dataset, and then reading it in the silverlight app.

Now when debugging, I use a local file, which is apparently not permitted

But there must be a way around it right?

View 2 Replies

Silverlight - Optimize Loading An XAP File With A Website?

Jun 10, 2010

I've been developing a game using Silverlight 4 and silversprite (http://silversprite.codeplex.com/)

This game is HEAVILY content dependent, using a lot of audio and images. My content folder is around 90 mbs worth of stuff. And because of that, my XAP file is around 60 MB, and takes 5 minutes to download from the website before any user can start playing.

I am using Visual Web Developer 2010 to create my site and load the XAP. Is there a way where I can take content out of my XAP and put it in my ASP.net site project? Or perhaps upload my content files to the site's storage?

This would make my XAP file much quicker to download.

View 2 Replies

Web Forms :: Embed Silverlight App In Aspx File?

Feb 14, 2010

I've created a silverlight application, MainPage.xaml has silverlight controls. The code behind of it will be definately in MainPage.xaml.cs file. When creating a silverlight app, I've selected a default web project wherein this silverlight app will be hosted and run. After all my work in MainPage.xaml.cs file, I want to integrate it in my default.aspx file. As i understand, I need to give reference to xap file in this aspx file. I tried accessing

<asp:Silverlight ID="xx" runat="Server.. />

tag but had no luck. This tag does not come up, Am i missing to add reference to any silverlight dll to my web application. Or is this tag applicable for Silverlight 2.0 and not 3.0 which I'm using:

<object data="SilverlightEmployeeExampleTestPage.aspx" width="100%" height="100%">
<param name="source" value="../ClientBin/SilverlightEmployeeExample.xap" />
</object>

View 2 Replies

C# - Automatically Open File After Downloading In Silverlight 4?

Dec 9, 2010

I am creating an excel spreadsheet server side and downloading to the client via a Silverlight front-end. It is started by the user clicking a button and being presented with a SaveFileDialog. Once the user enters a file name then silverlight starts an asynchronous call to a web service and when finished returns a byte array which is written to wherever the user requested to save it. This all works fine.How do I then automatically open this file on the client's PC?

View 1 Replies

Hosting Silverlight Xap File - Only White Screen Displayed

Feb 17, 2010

I have a SL 3.0 xap I want to host in a ASP.NET website, I have access to the XAP file and I have created a HTML page to host the SL component.

When I access the page all I see is a white screen where the SL component should be, SL is loaded but the component is not displayed.

This is the HTML code for the SL div.

<body>
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="http://lonmw32795/SliverlightRESTfulWebservice.Web/ClientBin/SliverlightRESTfulWebservice.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40818.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
</form>

View 3 Replies

Silverlight 3 Or 4 Multiple File Upload And Resize Control

Sep 1, 2010

Where can I find a silverlight 3 or 4 user control that contains multiple file upload and resize capability?

UPDATE:This will be used for uploading images. We'd like to resize the images prior to posting up to the server.

View 2 Replies

C# - PlatformNotSupportedException When Saving A File From Silverlight Through A Generic Handler

Jul 30, 2010

I have a Silverlight application hosted in an ASP.NET site, through which I'm starting an HttpWebRequest to a Generic Handler in order to save a CSV file to the user's machine.

From the Silverlight app, a Uri is constructed with parameters to make the CSV file server-side. A button is clicked which triggers the following:

string httpHandlerName = "HttpDownloadHandler.ashx";
// CustomUri handles making it an absolute Uri wherever we move the handler.
string uploadUrl = new CustomUri(httpHandlerName).ToString();
UriBuilder httpHandlerUrlBuilder = new UriBuilder(uploadUrl);
httpHandlerUrlBuilder.Query = string.Format("{3}startdate={0}&enddate={1}&partnerId={2}", startDate, endDate, partnerId, string.IsNullOrEmpty(httpHandlerUrlBuilder.Query) ? "" : httpHandlerUrlBuilder.Query.Remove(0, 1) + "&");
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(httpHandlerUrlBuilder.Uri);
webRequest.Method = "POST";
webRequest.BeginGetResponse(new AsyncCallback(GetResponseCallback), webRequest);

Now here is the ProcessRequest code from the HttpDownloadHandler.ashx

public void ProcessRequest(HttpContext context)
{
_httpContext = context;
string partnerId = _httpContext.Request.QueryString["partnerId"];
string startDate = _httpContext.Request.QueryString["startDate"];
string endDate = _httpContext.Request.QueryString["endDate"];
ExportCsvReport exportCsv = new ExportCsvReport();
_csvReport = exportCsv.ExportMemberRegistrationReport(partnerId, startDate, endDate);
context.Response.Clear();
context.Response.AddHeader("content-disposition", "attachment; filename=Report.csv");
context.Response.ContentType = "text/csv";
context.Response.Write(_csvReport);
}

Here is the HttpResponse header information that comes back when the Save File Dialogue refuses to appear:

{System.Web.HttpResponse}
Buffer: true
BufferOutput: true
Cache: {System.Web.HttpCachePolicy}
CacheControl: "private"
Charset: "utf-8"
ContentEncoding: {System.Text.UTF8Encoding}
ContentType: "text/csv"
Cookies: {System.Web.HttpCookieCollection}
Expires: 0
ExpiresAbsolute: {1/1/0001 12:00:00 AM}
Filter: {System.Web.HttpResponseStreamFilterSink}
HeaderEncoding: {System.Text.UTF8Encoding}
Headers: 'context.Response.Headers' threw an exception of type 'System.PlatformNotSupportedException'
IsClientConnected: true
IsRequestBeingRedirected: false
Output: {System.Web.HttpWriter}
OutputStream: {System.Web.HttpResponseStream}
RedirectLocation: null
Status: "200 OK"
StatusCode: 200
StatusDescription: "OK"
SubStatusCode: 'context.Response.SubStatusCode' threw an exception of type 'System.PlatformNotSupportedException'
SuppressContent: false
TrySkipIisCustomErrors: false

When I navigate to localhost/HttpDownloadHandler.ashx while the site is up, without initiating it from within the Silverlight app - the Save File Dialogue appears just fine, it seems to be a case where Silverlight is not accepting the response header properly.

View 2 Replies

How To Use An Image Or Icon Resource From Global Resource File

Jan 12, 2010

How can I use an image or icon resource from global resource file in an asp:Image control to set the ImageUrl attribute?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved