|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Browse an image of type .jpg, .gif, .png, or .bmp. Must be less than or equal to 10MB in size:<br />
<asp:FileUpload ID="fpImage" runat="server" />
<asp:RequiredFieldValidator ID="reqImage" Display="Dynamic" ControlToValidate="fpImage" style="font:12px verdana;color:Red;vertical-align:middle;" Text="(Required)" runat="server"></asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvImageType" Display="Dynamic" ControlToValidate="fpImage" OnServerValidate="cvImageType_Validate" style="font:12px verdana;color:Red;vertical-align:middle;" Text=" (Image must be any of these types: .jpg, .gif, .png, .bmp, .tif)" runat="server"></asp:CustomValidator>
<asp:CustomValidator ID="cvImageSize" Display="Dynamic" ControlToValidate="fpImage" OnServerValidate="cvImageSize_Validate" style="font:12px verdana;color:Red;vertical-align:middle;" Text=" (Image size must not exceed by 10MB.)" runat="server"></asp:CustomValidator>
<br /><br />
<asp:Button ID="btnResults" Text="Show Result" OnClick="btnResults_OnClick" runat="server" />
<br /><br />
<table cellpadding="0" cellspacing="0" border="0" style="width:800px">
<tr>
<td style="width:50%;padding-right:10px;text-align:center;">
<h3>Original Image</h3>
<asp:Image ID="imgOriginal" Width="380px" Height="380px" runat="server" />
</td>
<td style="width:50%;padding-left:10px;text-align:center;">
<h3>Resultant Image</h3>
<asp:Image ID="imgResult" Width="380px" Height="380px" runat="server" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Senior Software Professional with 13+ years of experience in web/desktop applications development.