473,804 Members | 3,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

savefiledialog for webforms

hi
I have a web page with displays informations from an xml. On the same
web page is a "save xml as" button and when the button gets fired, I
want to display a save as dialog for the user to save the xml in a file

on his client machine.
Is this possible to do, we have savefiledialog in winform but is there
any similar for webforms?
Any help wil be very mutch appreciated and if you can provide some code

examples I would be very happy woman!
Thanks

Sep 26 '06 #1
2 5991
Nope, you don't have any control over the client. The best you can do
is stream the xml and make sure to set the Content Headers correctly;
depending on the browsers settings, they may or may not get a save as
dialog.

HTH
Andy

kollatjo...@gma il.com wrote:
hi
I have a web page with displays informations from an xml. On the same
web page is a "save xml as" button and when the button gets fired, I
want to display a save as dialog for the user to save the xml in a file

on his client machine.
Is this possible to do, we have savefiledialog in winform but is there
any similar for webforms?
Any help wil be very mutch appreciated and if you can provide some code

examples I would be very happy woman!
Thanks
Sep 26 '06 #2
Hi,

If you can restrict your clients to IE then you can use the following JavaScript from your button's onclick event handler:

document.execCo mmand("SaveAs", true, null);

SaveAs Command on MSDN:
http://msdn.microsoft.com/library/de...nts/saveas.asp

All Commands on MSDN:
http://msdn.microsoft.com/library/de...commandids.asp

(Note that the document is out of date, somewhat. Some of the commands that say "Not currently supported" actually seem to work.
e.g. Undo and Redo.)

--
Dave Sexton

<ko*********@gm ail.comwrote in message news:11******** *************@k 70g2000cwa.goog legroups.com...
hi
I have a web page with displays informations from an xml. On the same
web page is a "save xml as" button and when the button gets fired, I
want to display a save as dialog for the user to save the xml in a file

on his client machine.
Is this possible to do, we have savefiledialog in winform but is there
any similar for webforms?
Any help wil be very mutch appreciated and if you can provide some code

examples I would be very happy woman!
Thanks

Sep 26 '06 #3

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

Similar topics

4
3454
by: Michael A. Covington | last post by:
I've just determined, by experimenting, that regardless of its Filter and DefaultExt properties, a SaveFileDialog will let you save the file with *any* registered extension. For instance, if you specify a SaveFileDialog with the attributes: AddExtension = true Filter = "Foo files|*.foo" DefaultExt = "foo"
6
19288
by: Ken Allen | last post by:
I have enocuntered something wierd. If I invoke an instance of the above dialog and elect to save the file in a directory where a file of that name does not exist, then the return is DialogResult.OK, but if I elect to save the file on top of a file with the same name in the same directory, when I press the Save button I get a "do you want to overwrite" dialog -- even if I press OK the SaveFileDialog returns DialogResult.Cancel! How...
2
1641
by: Yoshi | last post by:
Hi Everyone! I am using the SaveFileDialog class. I want the user to specify the "SaveAs" filename so I can use that name when creating a text document. Here is my question below. When the SaveFileDialog is displayed, how do you get it to show all the files that have the ".txt" extension? It's only showing me the folders. Thanks,
5
2816
by: juli | last post by:
Hello dear fellows! Is there any chance that you know how can I upload a file with the saveFileDialog control to a specific folder-> I want any file uploaded to be save on specific folder with specific name. Do you know how? Thank you very much!
3
3130
by: josh | last post by:
How do I make it actually save or open a file? It only opens the dialogs. What do I type to get it to save? Here's what I have so far: Public Class frmMainApp Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code "
2
20507
by: ad | last post by:
Hi, I want to use saveFileDialog to save a file (like c:\aa.zip) to another place. How can I assgin c:\aa.zip to saveFileDialog
17
8033
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: I am trying to use the SaveFileDialog class to get a filename, which is subsequently opened for writing (write access, read sharing, but using read/write sharing doesn't make the problem go away anyway). Sometimes, on the statement where I...
0
1149
by: kollatjorva | last post by:
hi I have a web page with displays informations from an xml. On the same web page is a "save xml as" button and when the button gets fired, I want to display a save as dialog for the user to save the xml in a file on his client machine. Is this possible to do, we have savefiledialog in winform but is there any similar for webforms? Any help wil be very mutch appreciated and if you can provide some code examples I would be very happy...
3
2669
by: =?Utf-8?B?UmljaA==?= | last post by:
I want to create a class library project (dll) for use with a com app. The idea is to use .Net objects in com. I also want to include a SaveFileDialog in the class library. Is it possible to include a SaveFileDialog object in my library project without having to include a form in the project? how to do this? Thanks, Rich
8
11636
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to replace" dialog, the DialogResult is Cancel instead of OK. Is there something I am missing? Dim lSaveFileDialog As New SaveFileDialog
0
9576
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10074
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9138
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.