Home » Programming » C# » Story Details
Printable Version

FileUpload Control in ASP.NET

by Manish Tewatia on May 23, 2012

Here i am going to explain about FileUpload Control in ASP.NET.
Comments: 1    Views: 3276

Introduction

FileUpload Control is used to upload any picture or any file in application. It provide a text box control, a browse button and a submit button. Browse button is used to select a file to upload on server. Submit button is used to submit image or file in application.

System.Web.UI.WebControls namespace is provide this feature in program and it found in System.Web (in System.Web.dll) assembly.

Properties

  • AccessKey
  • Adapter
  • AppRelativeTemplateSourceDirectory
  • Attributes
  • BackColor
  • BindingContainer
  • BorderColor
  • BorderStyle
  • BorderWidth
  • ChildControlsCreated
  • ClientID
  • ClientIDMode
  • ClientIDSeparator

Code that are used in FileUpload Control

<asp:FileUpLoad id="File1" runat="server" />
<asp:Button id="UploadButton" Text="Upload File" OnClick="UploadButton_Click" runat="server" />

.CS Code that are used in FileUpload Control

protected void UploadButton_Click(object sender, EventArgs e)
{
    if
 (File1.HasFile)
   {

        File1.SaveAs(@"C:\vipendra\" + File1.FileName);
        Label1.Text = 
"File Uploaded: "
 + File1.FileName ;
   }
   else
   { 
        Label1.Text = 
"No File Uploaded."
;
   }
}

Post a Comment
*
Iconic le créateur de Louboutin Homme traite son prodigieux succès remporté par ses semelles rouges signature avec magnanimité impressionnante.Christian Louboutin Mais le designer fran?ais a vu rouge,lorsque le géant Yves Saint Laurent aurait posé le pied sur la pointe des pieds par le déploiement de son propre ensemble de rouge à fond les talons. Gucci a leurs rubans rouges et verts, et je ne prendrais pas ce ruban et de le mettre dans mes Louboutin Femme. Pourquoi? Parce que j'ai un certain respect ", a déclaré Chaussures Louboutin, dont les réalisations ont porté sur les talons de Hollywood A-Listers y compris Blake Lively, Sarah Jessica Parker et Scarlett Johannsson.
DevExpress PowerBuilder Web Development Windows Development Languages Software Engineering Databases
iPhone Architecture Secutiry UML & Modeling Operating Systems Networking Testing
Graphics Design Project Management Hardware Open Source Games Development Business Intelligence Visual Studio LightSwitch 2011
MonoDevelop Visual Studio 2010 ASP.NET HTML, DHTML XML PHP JavaScript
Silverlight Web Services WCF Windows Forms WPF Windows Services Dynamic Link Libraries
ActiveX COM, DCOM, ATL C# VB.NET C++ F# Java
Pascal SQL Server Oracle DB2 MS-Access Windows Servers Windows
Linux Unix SAP LINQ .NET Framework ADO.NET Reporting
Crystal Reports SQL Server Reporting Services Igenda Reports Active Reports Adobe Fireworks Arrays & Collections Hosting
Future Trends Android Windows Phone Smart Devices Business M&A Investment & Funding
Web Browsers Internet Explorer Firefox Safari Common Entrepreneurs Students
Consulting Wiki Gadgets MobileMe iCloud iOS Social Media
Facebook Twitter LinkedIn Google+ Microsoft Kinect XBox
Wii Playstation DirectX i OS OS X CIO, CTO, CEO Windows 8
Web Design Expression Blend 4 Photoshop CS5 Creative Suite 5.5 Expression Web 4 Expression Studio 4 Creative Suite® 5.5 Design
Creative Suite 5.5 Web Creative Suite 5.5 Production Startups Funding M&A Laptops Smart Phones
Desktops Cameras & Camcorders Netbooks Tablets Virtualization Microsoft Surface WordPress
Software Products Cloud Computing Current Affairs Technology TV TV
Earnings XAML E-Commerce MonoTouch Mono for Android Deals Electronics
Mobile Phone Laptop Tablet Book Computer Press Releases Reviews
Products Books Companies Windows Azure SQL Azure Interviews Mac
Web Browsers Symbian Windows Forms WPF Windows Services HTML 5 Office 365
SharePoint 2010 Exchange Server Adobe Visual Studio 2012 iPad Flex / Flash Games
Windows 9
X
 Login
Please login to submit a new post, reply and edit exiting posts, see user profiles, and access more features. If you are not a registered member, Register here.
User Id / Email:
Password:  
Forgot Password | Forgot UserName