需要帮助以在Gridview中使用FileUpload Control [英] Need help to use FileUpload Control in Gridview

查看:92
本文介绍了需要帮助以在Gridview中使用FileUpload Control的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.,
任何人都可以向我发送示例代码,以便在gridview插入和编辑模板中使用fileUpload控件.
请紧迫.,

谢谢

Hi .,
Can anyone send me a sample code for using the fileUpload control in the gridview insert and edit templates.,

Please its urgent.,

Thanks

推荐答案

类似的讨论 [ ^ ]


确定...示例代码:
使用TemplateField列,然后在Item Template中放置fileUpload控件.
Sure...a sample code:
Use TemplateField column and in the Item Template put fileUpload control.
<asp:TemplateField>
    <ItemTemplate>
        <asp:FileUpload ID="FileUpload1" runat="server" />
    </ItemTemplate>
</asp:TemplateField>



从这里开始...尝试!



Start from here...Try!


尝试这个

try this

protected void GridView1_RowInserting(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
           
              FileUpload fileUploadProductImage = (FileUpload)row.FindControl("YourFileUploadName");
                if (fileUploadProductImage.HasFile == true)
                    {
                       //[Your Code]
                    }
        }


这篇关于需要帮助以在Gridview中使用FileUpload Control的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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