473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Webform issue with ASP.NET 2.0.

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.G etType(),
"imgExportToExcel_Click", "<script
language='JavaScript'>window.showModalDialog('Expo rtToExcel.aspx?ClientID="
+ ddlClients.SelectedValue + "&FromPeriod=1&ToPeriod=" +
ddlToPeriod.SelectedValue + "&BudgetYear=" + intSelBudgetYear + "',
null,'status:no;dialogWidth:240px;dialogHeight:150 px;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

Jan 4 '06 #1
1 1424
Hi,

I have sloved the problem. Instead of implementing the <base
target=_self></base> tag to get the modal webform to post to itself and
not a new window I have now changed into using an <iframe:

<iframe
src="ExportToExcel.aspx?ClientID=<%=Request.QueryS tring["ClientID"]%>&FromPeriod=1&ToPeriod=<%=Request.QueryString["ToPeriod"]%>&BudgetYear=<%=Request.QueryString["BudgetYear"]%>"
name="embeddedFrame" width="100%" height="100%" scrolling=no />

This works perfectly and the serverside code executes and displays the
open/save dialog when i push the Excel document to the client.

The strange thing is why my original solution worked in ASP.NET 1.1 but
not in ASP.NET 2.0 - to this I have not found an answer.

Sincerely,
Hans Sixhöj

Jan 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ester | last post by:
I would like to accomplish the following task in WebForm.aspx I have a SQL SELECT query that INNER JOIN two tables (Device_Tbl and Detail_Tbl) which will return Device_BtnID Status Z_Index ...
2
by: *no spam* | last post by:
I'm trying to figure out how to create a tabControl in a WebForm (I'm a newbie - sorry if this is a dumb question :) I've been able to set it up in a Windows Form, but would prefer to get it...
3
by: Prasad Patil | last post by:
Hi, I have a webform, The link on the webform should call the exe program installed on the client machine when the user click the link on the webform. It should run the exe installed on the...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
0
by: Lauchlan M | last post by:
<< Compiler Error Message: CS1595: 'myWebInterface.X.Y.AddEditUsers' is defined in multiple places; using definition from 'e:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET...
0
by: Lauchlan M | last post by:
<< Compiler Error Message: CS1595: 'myWebInterface.X.Y.AddEditUsers' is defined in multiple places; using definition from 'e:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET...
2
by: Craig Douthitt via DotNetMonster.com | last post by:
I am trying to capture an buttonclick on a usercontrol in the webform the usercontrol resides in. After researching this issue, I've come to believe that the best way of handling this is by raising...
2
by: syncwa | last post by:
Hi, Can someone point me to a example on how to do this from asp.net? An example is the best. Thanks
5
by: James Radke | last post by:
Hello, I am using VB.NET to call an unmanaged DLL which contains some functions. When I call the DLL from a windows application, it all works fine. When I place the same code in a webform...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.