PDA

View Full Version : [CLOSED] how do i assign image to <ext:image > from file uploader



amida
Apr 08, 2013, 3:36 PM
hello
I want to assign images directly from FileUploadField to ext Image here is my code

<ext:Image
ID="imgImageFile"
Width="150"
Height="150"
runat="server" />

<ext:FileUploadField
ID="fufImage"
runat="server"
ButtonOnly="true"
ButtonText=""
Icon="Attach">

</ext:FileUploadField>

Daniil
Apr 08, 2013, 4:06 PM
Hi @amida,

If I have got it correctly, you need an HBoxLayout.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Container
runat="server"
Width="300"
Height="50"
Layout="HBoxLayout">
<Items>
<ext:Image runat="server" ImageUrl="resources/images/test.png" Width="30" />
<ext:FileUploadField runat="server" Flex="1" />
</Items>
</ext:Container>
</form>
</body>
</html>

amida
Apr 08, 2013, 4:12 PM
thank u Daniil

i want to assign the selected image file from FileUploadField to image ImgUrl property directly

Baidaly
Apr 08, 2013, 10:35 PM
Hello!


thank u Daniil

i want to assign the selected image file from FileUploadField to image ImgUrl property directly

You have to upload selected image to the server and only then you will be able to assign it to ImageUrl because your browser doesn't have access to user's file system.