kankon says:
protected
void
OpenWindow(
object
sender, EventArgs e)
{
DataTable dt =
new
DataTable();
dt.Columns.AddRange(
new
DataColumn[11] {
new
DataColumn(
"Id"
),
new
DataColumn(
"idnamev"
),
new
DataColumn(
"idcivilv"
),
new
DataColumn(
"datesp10"
),
new
DataColumn(
"el3malv"
),
new
DataColumn(
"jop"
),
new
DataColumn(
"eldarajah"
),
new
DataColumn(
"vacationdata"
),
new
DataColumn(
"datestart"
),
new
DataColumn(
"dateend"
),
new
DataColumn(
"namevacation"
)});
foreach
(GridViewRow row
in
GridView1.Rows)
{
string
id = row.Cells[1].Text;
string
idnamev = (row.FindControl(
"lblidnamev"
)
as
Label).Text.Trim();
string
idcivilv = (row.FindControl(
"lblidcivilv"
)
as
Label).Text.Trim();
string
datesp10 = (row.FindControl(
"lbldatesp10"
)
as
Label).Text.Trim();
string
el3malv = (row.FindControl(
"lblel3malv"
)
as
Label).Text.Trim();
string
jop = (row.FindControl(
"lbljop"
)
as
Label).Text.Trim();
string
eldarajah = (row.FindControl(
"lbleldarajah"
)
as
Label).Text.Trim();
string
vacationdata = (row.FindControl(
"lblBoxDate3"
)
as
Label).Text.Trim();
string
datestart = (row.FindControl(
"lbldate"
)
as
Label).Text.Trim();
string
dateend = (row.FindControl(
"lbltime"
)
as
Label).Text.Trim();
string
namevacation = (row.FindControl(
"infosptex"
)
as
Label).Text.Trim();
dt.Rows.Add(id, idnamev, idcivilv, datesp10, el3malv, jop, eldarajah, vacationdata, datestart, dateend, namevacation);
}
Session[
"GridViewRow"
] = dt;
string
url =
"/Admin/vication.aspx"
;
string
s =
"window.open('"
+ url +
"', 'popup_window', 'width=800,height=950,resizable=no');"
;
ClientScript.RegisterStartupScript(
this
.GetType(),
"script"
, s,
true
);
}
Change with below code.
protected void OpenWindow(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[11] {
new DataColumn("Id"), new DataColumn("idnamev"), new DataColumn("idcivilv"), new DataColumn("datesp10"), new DataColumn("el3malv"), new DataColumn("jop"), new DataColumn("eldarajah"), new DataColumn("vacationdata"), new DataColumn("datestart"), new DataColumn("dateend"), new DataColumn("namevacation")});
GridViewRow row = ((sender as Button).NamingContainer as GridViewRow);
string id = row.Cells[1].Text;
string idnamev = (row.FindControl("lblidnamev") as Label).Text.Trim();
string idcivilv = (row.FindControl("lblidcivilv") as Label).Text.Trim();
string datesp10 = (row.FindControl("lbldatesp10") as Label).Text.Trim();
string el3malv = (row.FindControl("lblel3malv") as Label).Text.Trim();
string jop = (row.FindControl("lbljop") as Label).Text.Trim();
string eldarajah = (row.FindControl("lbleldarajah") as Label).Text.Trim();
string vacationdata = (row.FindControl("lblBoxDate3") as Label).Text.Trim();
string datestart = (row.FindControl("lbldate") as Label).Text.Trim();
string dateend = (row.FindControl("lbltime") as Label).Text.Trim();
string namevacation = (row.FindControl("infosptex") as Label).Text.Trim();
dt.Rows.Add(id, idnamev, idcivilv, datesp10, el3malv, jop, eldarajah, vacationdata, datestart, dateend, namevacation);
Session["GridViewRow"] = dt;
string url = "/Admin/vication.aspx";
string s = "window.open('" + url + "', 'popup_window', 'width=800,height=950,resizable=no');";
ClientScript.RegisterStartupScript(this.GetType(), "script", s, true);
}