Кнопки Datagrid Link запускают событие click и работают как положено, но когда я размещаю веб-приложение на IIS или на моем веб-сервере, событие кнопок Link не запускается, еще одна вещь, которую я заметил, что цвет кнопки Link немного отличается Когда я бежал с сервера и через Visual Studio, я прилагаю скриншоты с кодом. Я искал 2 дня, но все, что я могу найти, это просто включить или отключить кнопку ссылки. введите описание изображения здесь введите описание изображения здесь
if (e.CommandName == "btnDownload")
{
int index = int.Parse(e.CommandArgument.ToString());
string SerialNo = GridGetReport.Rows[index].Cells[2].Text;
string Name = GridGetReport.Rows[index].Cells[3].Text;
string ServerName = ConfigurationManager.AppSettings["Server"];
string Db = ConfigurationManager.AppSettings["Db"];
string UserName = ConfigurationManager.AppSettings["UserID"];
string Pwd = ConfigurationManager.AppSettings["Password"];
CrystalReport1 Rptr = new CrystalReport1();
Rptr.Load();
Rptr.DataSourceConnections[0].SetConnection(ServerName, Db, UserName, Pwd);
Rptr.SetParameterValue("@EmployeeID", SerialNo);
Rptr.SetParameterValue("@EmployeeID", SerialNo, Rptr.Subreports[0].Name.ToString());
Rptr.SetParameterValue("@EmployeeID", SerialNo, Rptr.Subreports[1].Name.ToString());
Rptr.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, SerialNo+" "+Name);
Response.End();
}
if (e.CommandName == "btnApprove")
{
int index = int.Parse(e.CommandArgument.ToString());
string SerialNo = GridGetReport.Rows[index].Cells[2].Text;
objTblEmploye = new tblEmployeeInfoTableAdapter();
objTblEmploye.QrUpdateEmpStatus(SerialNo);
int ReportTypeIndex = DropDownList1.SelectedIndex;
if (ReportTypeIndex == 0)
{
ObjSpGetEmpData = new spGetEmpDateBySerailNoTableAdapter();
GridGetReport.DataSource = ObjSpGetEmpData.SpGetEmpDataSerailWise(TextBox1.Text);
GridGetReport.DataBind();
}
else
{
ObjSpGetEmpData = new spGetEmpDateBySerailNoTableAdapter();
GridGetReport.DataSource = ObjSpGetEmpData.SpGetRptDateWise(DateTime.Parse(TxtStartDate.Text), DateTime.Parse(TxtendDate.Text));
GridGetReport.DataBind();
}
}