单击网格视图上的按钮后,文件上传控件缺少其文件如何获取文件路径 [英] after clicking button on grid view file upload control missing its file how to get file path

查看:78
本文介绍了单击网格视图上的按钮后,文件上传控件缺少其文件如何获取文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
当我单击按钮时,我已经将网格视图放置了一个按钮,并在gridview中放置了文件上传控件,我编写了类似

hi all
i have grid view placed one button and file upload control inside gridview when am clicking button i had written code like

protected void btnuploadimage_click(object sender, EventArgs e)
    {
        Button btngetpath = sender as Button;
        GridViewRow row = (GridViewRow)btngetpath.NamingContainer;
        FileUpload upctl = GridView1.Rows[row.RowIndex].Cells[5].FindControl("FileUpload4") as FileUpload;
if (upctl.HasFile)//here it show no file in fileupload and it going out side loop
        {

        }
    }


在调试时,它正在查找控件,但没有文件名,文件为false
很多人都遭受这个问题的困扰我如何通过多种方法尝试在此处获取文件路径,但未以任何方式获取文件,请帮助我
在此先感谢


when am debugging it is finding control but not having file name has file is false
lot of people suffer with this problem how con i get file path here i tried in many ways but am not getting file in any way please kindly help me
thanks in advance

推荐答案



看到此链接
如何在网格视图中管理文件上传控制

问候,

代数
Hi,

See this link
how to manage file upload control inside grid view

Regards,

Algem


这篇关于单击网格视图上的按钮后,文件上传控件缺少其文件如何获取文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆