B
Brian Conway
Can anyone tell me where I have this code messed up. It produces no errors,
but it does nto work either. The More command seems to work just fine, but
I can't tell whether this is an accident or whether it is because it is
coded right.
private void DataGrid1_ItemCommand(object
source,System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if
(e.CommandName.Equals("FindCUID"))
{
Fleet.LDAP.AuthenticationServices User = new
Fleet.LDAP.AuthenticationServices();
DataSet dsCUID = new DataSet();
dsCUID = User.getUserInfo((string)e.Item.Cells[5].Text);
Label1.Text = vdgCUID;
e.Item.Cells[8].Text = (string)dsCUID.Tables[0].Rows[0]["sn"];//matches
dataset fields with textbox.
e.Item.Cells[7].Text = (string)dsCUID.Tables[0].Rows[0]["givenname"];
}
if (e.CommandName.Equals("More"))
{Session["xUnit"] = e.Item.Cells[1].Text;
Session["xrcCode"] = e.Item.Cells[2].Text;
Session["xLastOdo"] = e.Item.Cells[3].Text;
Session["xDriver"] = e.Item.Cells[5].Text;
Session["xFirstName"] = e.Item.Cells[6].Text;
Session["xLastName"] = e.Item.Cells[7].Text;
Session["xLocation"] = e.Item.Cells[8].Text;
Session["xHome"] = e.Item.Cells[9].Text;
Server.Transfer("ChangeForm.aspx", true);
string sUrl = "ChangeForm.aspx";
string sFeatures = "'height=600;width=400;left=100;top=50;'";
string sScript;
sScript = "<script language=javascript>" +
"window.open('" + sUrl + "',''," + sFeatures + ");"+
"</script>";
// Write it into the output stream for immediate execution
Response.Write(sScript);}
}
but it does nto work either. The More command seems to work just fine, but
I can't tell whether this is an accident or whether it is because it is
coded right.
private void DataGrid1_ItemCommand(object
source,System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if
(e.CommandName.Equals("FindCUID"))
{
Fleet.LDAP.AuthenticationServices User = new
Fleet.LDAP.AuthenticationServices();
DataSet dsCUID = new DataSet();
dsCUID = User.getUserInfo((string)e.Item.Cells[5].Text);
Label1.Text = vdgCUID;
e.Item.Cells[8].Text = (string)dsCUID.Tables[0].Rows[0]["sn"];//matches
dataset fields with textbox.
e.Item.Cells[7].Text = (string)dsCUID.Tables[0].Rows[0]["givenname"];
}
if (e.CommandName.Equals("More"))
{Session["xUnit"] = e.Item.Cells[1].Text;
Session["xrcCode"] = e.Item.Cells[2].Text;
Session["xLastOdo"] = e.Item.Cells[3].Text;
Session["xDriver"] = e.Item.Cells[5].Text;
Session["xFirstName"] = e.Item.Cells[6].Text;
Session["xLastName"] = e.Item.Cells[7].Text;
Session["xLocation"] = e.Item.Cells[8].Text;
Session["xHome"] = e.Item.Cells[9].Text;
Server.Transfer("ChangeForm.aspx", true);
string sUrl = "ChangeForm.aspx";
string sFeatures = "'height=600;width=400;left=100;top=50;'";
string sScript;
sScript = "<script language=javascript>" +
"window.open('" + sUrl + "',''," + sFeatures + ");"+
"</script>";
// Write it into the output stream for immediate execution
Response.Write(sScript);}
}