Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Image preview before uploading using AsynFileUpload

$
0
0

Hello, I tried theexamplehere: http://www.dotnetspider.com/resources/40858-Preview-Image-before-uploading-using.aspx

Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ImagePreviewDemo._Default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"><title></title><script language="javascript" type="text/javascript">
        function getRandomNumber() {
            var randomnumber = Math.random(10000);
            return randomnumber;
        }
        function OnClientAsyncFileUploadComplete(sender, args)
        {
            var handlerPage = '<%= Page.ResolveClientUrl("~/ImageHandler.ashx")%>';
            var queryString = '?randomno=' + getRandomNumber();
            var src = handlerPage + queryString;
            var clientId = '<%=previewImage.ClientID %>';
            document.getElementById(clientId).setAttribute("src", src);
        }</script></head><body><form id="form1" runat="server"><asp:ToolKitScriptManager ID="toolKitScriptManager" runat="server"></asp:ToolKitScriptManager><asp:AsyncFileUpload ID="asyncFileUpload" runat="server"
                         OnClientUploadComplete="OnClientAsyncFileUploadComplete"
                         OnUploadedComplete="OnAsyncFileUploadComplete" /><asp:Image  runat="server" ID="previewImage" Height="546px" Width="671px" /></form></body></html>


howI can setthe displayed imagesize in IE?InFF and otherbrowserswork justsizingASP: Image, butfor some reasonIE ignores thesettingsand displays thefull-sizeimage


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>