1

我想从给定路径打开一个文件,并在链接按钮的点击事件上启用一个下拉列表。但只有文件被打开下拉列表未启用。两个控件都放置在网格视图中。尝试保持这两个任务正常运行,然后调用clickevent,仍然没有工作。即使我尝试在单击事件上显示弹出窗口并打开文件,它也不起作用。

protected void lnkvwReport_Click(object sender, EventArgs e)
{
    LinkButton lnkvwReport = (LinkButton)sender;
    GridViewRow row1 = (GridViewRow)lnkvwReport.Parent.Parent;
    DropDownList ddlfeedback = ((DropDownList)row1.FindControl("ddlfeedback"));
    ddlfeedback.Enabled = true;  //DOESN'T WORK
    //FILE OPENING PART - WORKS
    string savepath="PATH_TO_FILE";
    string filename=savepath+"Report";
    Response.AddHeader("content-disposition","inline;filename=report");
    Response.ContentType="application/vns.ms-excel";
    Response.Flush();
    Response.WriteFile(filename);
    Response.End();

}
4

0 回答 0