.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

Rebind datalist after upload an image using jquery

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :ASP.Net

Hi, I'm having a problem with using jquery to trigger a datalist rebind here, hope people here could help me with it. 

I'm using a jquery plugin called uploadify to upload images to my database. I'd like my datalist to be auto-rebind after the images' been uploaded so people could see the changes immediately. Also because this is a feature for admin there is a delete button in the datalist. I used updatePanel for this.  

I put __doPostBack('" + upnlUploaded.ClientID + "','') to the javascript so when Images have been uploaded the update panel will postback. 

I also have the following two lines to make it working... 

<asp:UpdatePanel ID="upnlUploaded" runat="server" UpdateMode="Conditional" OnLoad="upnlUploaded_Load"> <%--upnlUploaded_Load   --%>

       <asp:UpdatePanel ID="upnlUploaded" runat="server" UpdateMode="Conditional" OnLoad="upnlUploaded_Load"

        protected void upnlUploaded_Load(object sender, EventArgs e)

More Related Resource Links

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Multi File Upload Using JQuery!

Everyone knows about the file upload in .NET. But the multi file upload is some what difficult in .NET. For that purpose we can have some AJAX or JQuery!. Jquery is the latest advanced version. It will give some animated upload. You can try it for your own!!!!

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:

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

Upload transparent PNG image


Hi everybody

I'm creating a website where it must  be able to upload, crop and resize images. This works until I use transparent PNG images. When I upload a transparent PNG, the transparency becomes black. I've searched the whole internet, but found no solution so far. Can someone help me? This is my code. I'm working with MVC 2.

			try {
				HttpPostedFileBase file = Request.Files["image"];
				file.SaveAs(Server.MapPath("/Uploads/" + file.FileName));

				ViewData["ImageLocation"] = "/Uploads/" + file.FileName;
				return View();
			catch (Exception exc) {
				return RedirectToAction("UploadImage");

How to upload image in Mobile Application?


I have requirement to upload the image in mobile Web application using asp.net. For this I have add mobile templates but regarding to image there is no any file upload control. Then I see one article and use the below code:

<mobile:DeviceSpecific ID="DeviceSpecific1" Runat="server">
                <input style="width: 389px; height: 22px" type="file" size="45" runat="server" id="FileUpload1">

jquery image loader in asp.net repeater

Hello folks., i am binding images to repeater from database. i want to load images one by one till that time imageloader.gif should display in place of all the loading Images. Plz suggest me any idea,i would like to use jquery for this.. thank youHello folks.,i am binding images to repeater from database.i want to load images one by one till that time imageloader.gif should display in place of all the loading Images.Plz suggest me any idea,i would like to use jquery for this..thank you

Need to upload images with data, but image url's are in separate db table

Hello, I'm making a simple homes classifieds section and when a home ad is created, a HomeID is automatically created for it in the db.  I need the images to upload and enter the associated HomeID with each image automatically.  What I tried isn't working, because it looks like it's looking for the HomeID in the codebehind before it gets entered into the db.ASPX CODE<asp:SqlDataSource ID="SqlDataSource1" runat="server"         ConnectionString="<%$ ConnectionStrings:ConnectionString %>"         InsertCommand="INSERT INTO [Homes] ([UserName], [Street], [Details], [Contact], [Phone], , [Thumb], [Price], [Approved], [Posted]) VALUES (@UserName, @Street, @Details, @Contact, @Phone, @Email, @Thumb, @Price, @Approved, @Posted)"         SelectCommand="SELECT [HomeID], [UserName], [Street], [Details], [Contact], [Phone], , [Thumb], [Price], [Approved], [Posted] FROM [Homes]" >        <InsertParameters>            <asp:Parameter Name="UserName" Type="String" />            <asp:Parameter Name="Street" Type="Str

Image upload not working in updatepanel

Hi, in my update panel i need to upload a image.my Fileupload control within update panel.so when i check is it correct format or not in following code then it always take else part. Dim fileUpload1 As FileUpload = CType(Me.FindControl("FileUpload1"), FileUpload)            'Make sure a file has been successfully uploaded            If fileUpload1.PostedFile Is Nothing OrElse String.IsNullOrEmpty(fileUpload1.PostedFile.FileName) OrElse fileUpload1.PostedFile.InputStream Is Nothing Then                Label1.Text = "Please Upload Valid picture file"                Exit Sub            End If            'Make sure we are dealing with a JPG or GIF file            Dim extension As String = System.IO.Path.GetExtension(fileUpload1.PostedFile.FileName).ToLower()            Dim MIMEType As String = Nothing            Select Case exte

Upload image to database - couldn't find file path

I'm trying to display images in a GridView (yes, still this...). [edit] Before I can come to that I have to upload some images to the database.I've followed this tutorial for the "upload image to database" code (this worked fine for uploading images, but I don't know if the images were converted to byte):http://aspsnippets.com/Articles/Save-Files-to-SQL-Server-Database-using-FileUpload-Control.aspxand I've followed this tutorial for the "display images in gridview" code (and "retrieve file" from the tutorial below).http://www.aspsnippets.com/Articles/Display-images-from-SQL-Server-Database-in-ASP.Net-GridView-control.aspxIt doesn't quite work, the GridView shows but without imagesNow I'm trying to change the "save file" code according to this tutorial:http://aspsnippets.com/Articles/Save-and-Retrieve-Files-from-SQL-Server-Database-using-ASP.Net.aspxbut I don't understand everything in it. When I try to upload an image I get an error on this line:FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read); //couldn't find file (path to image I tried to upload) What should I do about it?

rezise image on upload

Hi have the following method to upload images but I want to resize every image uploaded to 90x40 can anyone help me to edit this code so this will happen cheers   private string UploadFile(string pathToSave, FileUpload uploadfile)        {            string strFileName;            string strFilePath;            string strFolder;            string file_version = "";            strFolder = Server.MapPath("~/images/" + pathToSave);             // Retrieve the name of the file that is posted.            strFileName = uploadfile.PostedFile.FileName;            strFileName = Path.GetFileName(strFileName);             if (uploadfile.HasFile)            {                // Create the folder if it does no

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 upload????

in my project the client will upload his image that image should apper in the image box how can i do this???

Show image after upload at same time

I want to show uploaded image at same moment. I use this code: protected void FileUploadLaptop_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "size", "top.$get(\"" + lblErrorMessage.ClientID + "\").innerHTML = 'Uploaded size: " + FileUploadLaptop.FileBytes.Length.ToString() + "';", true); string savePath = MapPath("~/Uploads/" + System.IO.Path.GetFileName(e.filename)); FileUploadLaptop.SaveAs(savePath); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "image", "top.$get(\"" + imgLaptop.ClientID + "\").src = 'Uploads/" + System.IO.Path.GetFileName(e.filename) + "';", true); imgLaptop.ImageUrl = savePath; imgLaptop.DataBind(); } *** Picture upload to path but image control doesn't show it. what is wrong?

Jquery to display image map in sharepoint


I need to use google maps in sharepoint site .

and need to highlight on mouseover location stored in the list.

this list contains location name and co-ordinates of the location.

how can I use Jquery to display image map in sharepoint.Plesae give some initial thoughts.


How to retrive client name ,Field , and Image from Database and show in datalist?


hi experts,

i wanat to display Client Name, Field and  image in datalist. Stored Procedure like this

ALTER proc [dbo].[get_clients_services]
SELECT     Clients.ClientName AS Client, Fields.FieldName AS Field, ServiceType.ServiceType AS Services, ServiceType.Servicelink AS Link, 
                      Clients.ClientLogo AS Logo
FROM         Clients INNER JOIN

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