F
ffhansix
Hi,
I have migrated a web site from .NET 1.1.4322 to .NET 2.0. After the
migration my Modal webform does not work as it did in 1.1.
The webform pops up from a page when a user clicks a button:
The following line is run in the codebehind file:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"imgExportToExcel_Click", "<script
language='JavaScript'>window.showModalDialog('ExportToExcel.aspx?ClientID="
+ ddlClients.SelectedValue + "&FromPeriod=1&ToPeriod=" +
ddlToPeriod.SelectedValue + "&BudgetYear=" + intSelBudgetYear + "',
null,'status:no;dialogWidth:240px;dialogHeight:150px;dialogHide:true;help:no;scroll:no');</script>");
Both pages that run (both the startpage and the modal webform page) has
the @page directive enableEventValidation="false".
On the modal webform page there are two buttons (servercontrols) cancel
and ok, if the user presses ok, some lines are executed to create an
Excel spreadsheet with the help of a third-party serverside component
(Aspose.Excel).
Extract.....
Response.ContentType = "application/vnd.ms-excel";
objExcel.Save(Settings.ExcelSettings_FileName, SaveType.OpenInExcel,
(Aspose.Excel.FileFormatType) intExcelVersion, this.Response);
......
The code does exactly what it should do (give the user a question,
open/save dialog for the generated Excel file) if i remove the <base
target=_self></base> from the aspx page, but then at every post i make
a new window is opened.
Could someone please help me with this issue, i have tried changing
many things but i just cannot get it to work as it did in .NET 1.1.
Sincerely
/Hans Sixhöj
I have migrated a web site from .NET 1.1.4322 to .NET 2.0. After the
migration my Modal webform does not work as it did in 1.1.
The webform pops up from a page when a user clicks a button:
The following line is run in the codebehind file:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"imgExportToExcel_Click", "<script
language='JavaScript'>window.showModalDialog('ExportToExcel.aspx?ClientID="
+ ddlClients.SelectedValue + "&FromPeriod=1&ToPeriod=" +
ddlToPeriod.SelectedValue + "&BudgetYear=" + intSelBudgetYear + "',
null,'status:no;dialogWidth:240px;dialogHeight:150px;dialogHide:true;help:no;scroll:no');</script>");
Both pages that run (both the startpage and the modal webform page) has
the @page directive enableEventValidation="false".
On the modal webform page there are two buttons (servercontrols) cancel
and ok, if the user presses ok, some lines are executed to create an
Excel spreadsheet with the help of a third-party serverside component
(Aspose.Excel).
Extract.....
Response.ContentType = "application/vnd.ms-excel";
objExcel.Save(Settings.ExcelSettings_FileName, SaveType.OpenInExcel,
(Aspose.Excel.FileFormatType) intExcelVersion, this.Response);
......
The code does exactly what it should do (give the user a question,
open/save dialog for the generated Excel file) if i remove the <base
target=_self></base> from the aspx page, but then at every post i make
a new window is opened.
Could someone please help me with this issue, i have tried changing
many things but i just cannot get it to work as it did in .NET 1.1.
Sincerely
/Hans Sixhöj