Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
For editing.. I use Textbox1.Text=Id.text ..what is the extension for fileupload. anybody please help me i am new to asp.net

C#
if (e.CommandName == "Edit")
        {
            LinkButton LinkButton1 = (LinkButton)e.CommandSource;
            GridViewRow Gr = ((GridViewRow)LinkButton1.NamingContainer);
          int  Id = Convert.ToInt32(GridView1.DataKeys[Gr.RowIndex].Values["ID"].ToString());

            Label Id1 = (Label)Gr.FindControl("Lid");
        //  id =int.Parse(Id1.Text);
            Label Name = (Label)Gr.FindControl("Lapplication");
            Label Father = (Label)Gr.FindControl("Lfather");
            Label Sex = (Label)Gr.FindControl("Lsex");
           Label DOB = (Label)Gr.FindControl("Ldob");
            Label Address = (Label)Gr.FindControl("Laddress");
            Label Phone = (Label)Gr.FindControl("Lphone");
            Label Marks = (Label)Gr.FindControl("Lmarks");
            Label Group= (Label)Gr.FindControl("Lgroup");
            Label City = (Label)Gr.FindControl("Lcity");
            Image  Photo = (Image)Gr.FindControl("Lphoto");


            TextBox1.Text = Id1.Text;
            TextBoxApplication.Text = Name.Text;
            TextBoxFather.Text = Father.Text;
            RadioButtonListSex.Text=Sex.Text;
         
                
            TextBoxAddress.Text=Address.Text;
            TextBoxPhone.Text=Phone.Text;
            TextBoxMarks.Text=Marks.Text;
            RadioButtonList2.Text=Group.Text;
            DropDownListCity.Text=City.Text;  
       //    FileUploadPassport.FileName=Photo.????????
                
                

            GridBind();
        }
Posted
Updated 25-May-15 23:59pm
v5

If you mean the FileUpload Control, then it's:
C#
if (FileUpload1.HasFile)
    {
    string fileName = FileUpload1.FileName;


If you don't, then what do you mean?
 
Share this answer
 
Hi ,

You cant again relaod the file loacation agian to uploader control,insted of that try to load the image in image viewer control in edit mode
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900