File Name Retrive After Upload Image OR Document Files Using Asp.Net C#

File Name Retrive After Upload Image OR Document Files


Get the Name From Uploaded File or Image Name  Using Asp.net C#.


Multiple Image Upload
Image Update in Gridview   
Show Image Preview
Restrict Upload File Size
Image Insert Bind  GridView
Without Database Upload Image Show

                      DEMO



                          Download Coding
                  
                                           Download
                                                        Html Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
  
 <asp:FileUpload ID="FileUpload1" runat="server" />
        <br />
        <br />
        <asp:Button ID="btnUpload" runat="server"  Text="Upload " OnClick="btnUpload_Click" />
        <asp:Label ID="lblGetImageName" runat="server"></asp:Label>
  
    </div>
    </form>
</body>
</html>



C# Coding


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class UploadImageName : System.Web.UI.Page{  

  protected void Page_Load(object sender, EventArgs e)
  {  

  } 
  protected void btnUpload_Click(object sender, EventArgs e)
    {

        lblGetImageName.Text = FileUpload1.FileName; 

   }

}





First - Add - New Web Form  -  Select FileUploadedr ,Button,Label From ToolBox







Next - Button Double Click -  Write The Coding 









OUTPUT



Next - Run (F5) - Select Iamge or File Name Upload Get Name
















0 comments:

Post a Comment