Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to open a file from given path and enable a dropdownlist on click event of linkbutton. But only file gets opened dropdownlist is not enabled.Both the controls are placed in a gridview. Have tried keeping the two task in function and then calling on clickevent, still didn't work. Even when i tried to display a popup and open a file on click event it didn't work.

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();

}
Posted
Comments
Check if you are getting the correct row or not after this line...

GridViewRow row1 = (GridViewRow)lnkvwReport.Parent.Parent;
shwetasindhu51 15-Jun-13 4:20am    
Yes row is correct as the opened file is correct

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900