在编辑时将文件上传到gridview。 [英] Fileupload to gridview in editing.
本文介绍了在编辑时将文件上传到gridview。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
编辑..我使用Textbox1.Text = Id.text ..是什么是fileupload的扩展名。任何人请帮助我我是asp.net的新手
For editing.. I use Textbox1.Text=Id.text ..what is the extension for fileupload. anybody please help me i am new to asp.net
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();
}
推荐答案
如果你的意思是FileUpload Control,那么它是:
If you mean the FileUpload Control, then it's:
if (FileUpload1.HasFile)
{
string fileName = FileUpload1.FileName;
如果不这样做,那你的意思是什么?
If you don't, then what do you mean?
你再也无法将文件loacation agian重新加载到上传器控件上,试图在编辑模式下在图像查看器控件中加载图像
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
这篇关于在编辑时将文件上传到gridview。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文