M
Mahernoz
Hi Friends,
I simply want to print a report by opening a popup, calling the print
function and closing the window after the user has printed the
report.
I have 2 functions.... in c#
The Onload event registers a script to close the window from c#. The
FillReport functions fills a gridview
I have a JavaScript Function AssignContent(); which simply calls
window.print() and window.close()
This code runs fine in Firefox but the window is not closing in
Internet Explorer 6
I am also giving the code ... plz suggest me some solution.. i simply
cannot close the window in ie6.
Here is the code....
C# Code
---------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
fillreport();
if (!ClientScript.IsClientScriptBlockRegistered("k1"))
{
ClientScript.RegisterClientScriptBlock(this.GetType(),
"k1", "<script language='javascript'>AssignContent();</
script>");
}
}
}
private void fillreport()
{
//fills a gridview
}
//JavaScript
-------------------------------------
function AssignContent()
{
window.print();
window.close();
}
Regards,
Mahernoz
I simply want to print a report by opening a popup, calling the print
function and closing the window after the user has printed the
report.
I have 2 functions.... in c#
The Onload event registers a script to close the window from c#. The
FillReport functions fills a gridview
I have a JavaScript Function AssignContent(); which simply calls
window.print() and window.close()
This code runs fine in Firefox but the window is not closing in
Internet Explorer 6
I am also giving the code ... plz suggest me some solution.. i simply
cannot close the window in ie6.
Here is the code....
C# Code
---------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
fillreport();
if (!ClientScript.IsClientScriptBlockRegistered("k1"))
{
ClientScript.RegisterClientScriptBlock(this.GetType(),
"k1", "<script language='javascript'>AssignContent();</
script>");
}
}
}
private void fillreport()
{
//fills a gridview
}
//JavaScript
-------------------------------------
function AssignContent()
{
window.print();
window.close();
}
Regards,
Mahernoz