In this task is already Cancelled msg not showing
In both cases alert message not showing in row command event of gridview
protected void grdmanage_tasks_RowCommand(object sender, GridViewCommandEventArgs e)
{
//here is code for find taskid
switch (e.CommandName)
{
case "manage":
DataSet ds1 = sql.getds("select task.task_id,taskid,task_title,convert(varchar(24),deadline_date,113)as deadline_date,deadline_hour+':'+deadline_minutes as deadline_time,convert(varchar(24),send_observe_date,113) as send_observe_date ,convert(varchar(5),send_observe_time,108)as send_observe_time,users.user_name,task.task_status from task join users on users.user_id=task.alloteduser_id where task.taskid='" + taskid + "' ");
grdmytasks.DataSource = ds1;
grdmytasks.DataBind();
// do something using the ID
break;
case "taskcancel":
// do something else using the ID
if(first condition)
{
ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('This task is already Cancelled.');</script>", false);
}
if (2nd condition)
{
ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Sorry, this task can't be cancelled.');</script>", false);
}
if(3rd condition)
{
ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Task Cancelled successfully.');</script>", false);
}
}
}