链接按钮点击 [英] Link button click

查看:77
本文介绍了链接按钮点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望单击链接按钮后,它会采用文件上载的名称,否则要对该属性赋予相同的先前图像名称,即Pimage

我怎么能得到那东西?这不起作用

I want that once the link button is clicked than it takes the file uploaded name, otherwise the same previous image name to be given to that property i.e. Pimage

How can I get that thing? This is not working

objprp.details = (TextBox4.Text).ToString();
    objprp.news = (TextBox3.Text).ToString();
    if (LinkButton1.Enabled = true)
    {
        String fn1 = FileUpload2.FileName;
        String sp1 = Server.MapPath("ServerPics/newsimages");
        sp1 += "\\" + fn1;
        FileUpload2.PostedFile.SaveAs(sp1);
        Image1.ImageUrl = sp1;
        objprp.nimg = (fn1).ToString();
    }
    else
    {
        objprp.nimg = (TextBox6.Text).ToString();
    }
    obj.updatenews(objprp);
    Literal1.Text = "NEWS RECORD Updated";
}

推荐答案

我认为您无法做到这一点.您需要在上传字段旁边显示已经上传的文件的名称,并将上传字段留空
I don''t think you can do that. You need to display the name of the already uploaded file next to the upload field and leave the upload field blank


这篇关于链接按钮点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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