.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

how to refresh image updated with AsyncFileUpload

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

I've created an AsyncFileUpload device that uploads an image in ListView but it doesn't refresh on the page until the page is manually refreshed. Any ideas on how to accomplish this? This is the applicable code:

In ListView control:

<asp:UpdatePanel ID="udpPhoto" runat="server">
        <span style="text-align: center; vertical-align: middle; font-size: 7pt;">
            <br />
            <asp:Button ID="btnEPhoto" Font-Bold="False" TabIndex="160" Text="Upload/Change Photo"
                UseSubmitBehavior="False" OnClick="btnPhoto_Click" runat="server" />
            <br />
            <asp:Label ID="lblEPhoto" runat="server" Font-Bold="True" Text="Uploaded Photo:" />
            <br />
            <asp:HyperLink ID="lnkEPhoto" runat="server" BorderWidth="2px" NavigateUrl='<%# Eval("Photo_Recent") %>'
                <asp:Image runat="server" ImageUrl='<%# Eval("Photo_Recent") %>' Height="50px" ID="imgEPhoto">

View Complete Post

More Related Resource Links

AsyncFileUpload: Throw Error on image size


I have an AsyncFilUpload that is used to upload  to my site. On the server side I have code that checks the width and height of the image and will only save the image if it is within the limits buit I can't figure out how to get the AsyncFileUpload control to show an error when this happens. Can anyone give me any pointers?


Refresh Cached image

Hello! I have an Image that is cached because I want to be able to change the file on runtime without getting exception about the file being in use. This works fine, but how can I programatically force a refresh of the image from file. I have a function that replace the file, so it would be nice to have a refresh function.  Is this possible?   <Image Name="imageThatIWouldLikeToRefreshFromCode"> <Image.Source> <BitmapImage UriSource="C:\image.jpg" CacheOption="OnLoad" /> </Image.Source> </Image>

Refresh an image with jquery

Hi,how can I refresh an image with below script.This  url returns '/CAPTCHAImage' an gif. I can get image with this but I can't set the gif to img.How can I do this?Kind regards.$.get('/CAPTCHAImage', function(data) { $("#guvenlikKodu").attr("src",data);});

Image Refresh problem


Im quite new to WPF and I'm stuck with an refresh issue.
The scene is as follows:

1) I have a form with an image on it.
2) A screenshot is made, and saved to the above mentioned image. (from the app)
3) The image should be refreshed to show the new image (but same file)

However I can not get it to work.
I can see the file is changing on the disk (viewing it and timestamp) and even in the WPF designer the image changes, but not in the running app :-/

I don't know what wrong. (other than the image does not refresh). So can anyone help?
My code is as follows:


<Window x:Class="Imagetest.Window1"




how can i call the AsyncFileUpload's click method by a image



i want to make something like that

<cc1:AsyncFileUpload runat="server" id="upload"

<img onclick='upload.click()'/>

i tried lots of script but it doesnt work. Can anyone help?

can't refresh image in ModalPopup


I have a page where the following code works to refresh an updated image, but it won't work in another page. (The Util.FindChild is an enhanced FindControl that I use.) I'm sure it has to do with the ModalPopupExtender not closing but I don't know what to do about it. I also use a ModalPopupExtender on the other page and it works--in fact, both are virtually identical since they both originate from the same user control. Any ideas?

'these three statements could be cleaner but at present 
'they come from a number of controls in different templates
Dim img As WebControls.Image = DirectCast(Util.FindChild(Me, "imgUploaded"), WebControls.Image)
If img Is Nothing Then img = DirectCast(Util.FindChild(Me, "imgUploadedE"), System.Web.UI.WebControls.Image)
If img Is Nothing Then img = DirectCast(Util.FindChild(Me, "imgUploadedT"), System.Web.UI.WebControls.Image)
If img IsNot Nothing Then
   ScriptManager.RegisterClientScriptBlock(Me, _
      GetType(Page), _
      "imageRefresh", _
      "window.parent.document.getElementById('" _
      + img.ClientID + "').src='" + strFile + "?t=" + _
      (New Random().Next(9999)).ToString() + "';", _
End If

Best way to refresh windows/controls in case relevant data has been updated


I have an application with number of screens used to edit/display data. In case any of screens is edited, all dependant screens must be refreshed. I do not want to refresh data used by screens each time they become active. I was thinking of creating an interface:

interface IRefreshable { void Resfresh() }

All child windows(=screens) will implement this interface. Once any of the screens is saved it will notify it's parent window (=main app window) what kind of data was resfreshed. Main window will permanently store list of all child windows that are affected by specific change and will resfresh them.

class Main:Form{

  private  static Dictionary<DataType, List<IRefreshable>> resfreshableDict;

  static Main()


    // initialize resfreshableDict



  public Refresh(DataType type)


    // fetch IResfreshable for the type from resfreshableDict and invoke Resfresh()





class TaxesScreen: Form, IRefreshable


  private saveData()


    // save data

    // notify parent about the change of taxes data


WDP 2010 builds fail, .refresh file references not updated, dll files not copied to bin folder prio


I dont know if anybody else has seen this yet:  We use web deployment projects with web sites (not wap) and upgraded to VS2010.  When we build on our production build server (CruiseControl.Net) We found that the compile step fails because it could not find the dll files referenced in the bin folder .refresh files. 

Since the only the .refresh files are checked in, and we get a completely new copy of the source before every build, the dll files themselves need to be copied into the bin folder as part of the build.

Looking at the original source folder and the \obj folder we can see the dll files are not getting copied.

I think the problem is something in the new WebDeployment.targets file - specifically in the _ResolveReferences target.  I removed the Condition= from the Copy item and (~line 823) and it works fine now.

 <Target Name="_ResolveReferences" DependsOnTargets="_PrepareForBuild;GetRedistLists">
        <CreateItem Include="$(_FullSourceWebDir)\Bin\*.refresh">
            <Output TaskParameter="Include" ItemName="References_RefreshFile" />
        <ReadLinesFromFile File="%(References_RefreshFile.Identity)" Condition=" &#

Built-in Functions - Text and Image Functions in SQL Server

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Program for Format Conversion of An Image

.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Configuring Profile Image Export in SharePoint 2010

It's no secret that I am thrilled with the new social features of SharePoint 2010. I am most excited about the new Profile Picture handling. I strongly believe that the more we can show the faces of our colleagues to one another the more connected we will feel. Clearly Microsoft feels that way as witnessed by the many features that make use of the Profile Image like the Activity Feed and Colleagues list

Built-in Functions - Text and Image Functions

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

ASP.Net Upload Image to MS Access Database

As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

slideshow image gallary using jQuery



i need a gallary like following link.


actually,i bound multiple image in a gridview using handler(.ashx).

for example,in one dep_id(1),there are 6 image and i need to slideing one by one.

could some one help me,how i can do like this?

i think is it easy in jquery.

please someone help me.

Thanking you.

datalist image slide show problem


hi friends

i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />

I above code works perfectly and the slide show e

Can't display an image from the database



My database has a products table that has images stored in a varbinary(MAX) column.

I'm trying to display product information in a repeater and trying to display the images as well by using a GenericHandler class but I can't get the image to show up in my page.

Here is my Handler.ashx class:

Public Class Handler
    Implements System.Web.IHttpHandler

    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

        '== Set up the response settings
        context.Response.ContentType = "image/gif"
        context.Response.BufferOutput = False

        Dim id As Integer = -1
        Dim stream As Stream = Nothing
        If Not String.IsNullOrEmpty(context.Request.QueryString("id")) Then
            id = context.Request.QueryString("id")
            stream = GetImage(id)
        End If

        Const buffersize As Integer = 1024 * 16
        Dim buffer(buffersize) As Byte
        'byte[] buffer = new byte[buffersize];
        Dim count As Integer = stream.Read(buffer, 0, buffersize)

        While count > 0
            context.Response.OutputStream.Write(buffer, 0, count)
            count = stream.Read(buffer, 0, buffersize)
        End While

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend