Welcome to Dream.In.Code
Become an Expert!

Join 149,495 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,347 people online right now. Registration is fast and FREE... Join Now!




Content Header Problem?

 
Reply to this topicStart new topic

Content Header Problem?

venkatzeus
11 Mar, 2007 - 10:52 PM
Post #1

New D.I.C Head
Group Icon

Joined: 8 Mar, 2007
Posts: 8


Dream Kudos: 25
My Contributions



Hi ,

I do have a page in which I want to open an xml file in a button click. In the button click am opening an aspx page through JavaScript location.href(). In the aspx page am simply adding a file using an addheader method and using response.write am writing an XML string to that file. Like ...
CODE

Response.AddHeader("Content-disposition", "attachment; filename=" + FileName + ".xml");
Response.ContentType = "application/xml";
Response.Write(FileContent);

The problem is something like when am clicking the button in the main page the dialog window asking whether to Open, Save or Cancel is popping out, if am giving Open then the particular Xml file is been opened in the same page. I do want to open this particular Xml file in another blank window. Is this possible? If possible how can I do that?

Thanks in Advance.
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Content Header Problem?
11 Mar, 2007 - 10:58 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,303



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
There are a couple of ways you can do that. You can pass the information using a Query String to a new page to be rendered.
http://www.codeproject.com/aspnet/QueryString.asp


You can use Response.Redirect to open a new page.
http://support.microsoft.com/kb/312063

How to pass data between ASP.NET pages.
User is online!Profile CardPM
+Quote Post

venkatzeus
RE: Content Header Problem?
12 Mar, 2007 - 04:13 AM
Post #3

New D.I.C Head
Group Icon

Joined: 8 Mar, 2007
Posts: 8


Dream Kudos: 25
My Contributions

Thank You very Much.

I am able to get the xml page in a new window. Actually when you click the master page's button that time itself the pop window is popping up.. When that page is been loaded since in that page header we are appending the content the download window is popping out. At that time if am canceling or even if am saving the content the opener pop window is still there. I want to kill that window in case of cancel or save.

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 05:58PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month