hi,
i was developing a client web application which get the search file result from a web service , after getting the result, i would store it in a datagrid, then i would need to click the download button which retrieve the one value of the datagrid to be pass back to the web service, however, whenever it execute OnItemCommand="callDownloadFile" , it seems cant' retrieve the value from the datagrid, n i found tat whenever i click the download button , e.Item.DataItem will be NUL.. i know tat i need to rebind the result , however... i can't bind it properly..
anyone can help out with this? thanks..
Code:
private void Page_Load(object sender, System.EventArgs e)
{
//getAuthenticate();
if (!Page.IsPostBack)
{
callSearchFile();
}
callSearchFile();
}
public void callSearchFile()
{
DataGrid1.DataSource = service.SearchFile("text");
DataGrid1.DataBind();
}
public void callDownloadFile(Object sender, DataGridCommandEventArgs e)
{
if (e.Item.DataItem != null)
{
if(e.CommandName=="download")
{
Response.Write("second 3");
string path = ((Label)e.Item.FindControl("lblPath")).Text;
//Response.Write(strID);
}
}
else
{
Response.Write("second one");
}