473,624 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Avoiding the "File download" dialog when using the WebBrowser control to navigating to an excel file (C#/Windows Forms)

Hi,

My Windows Forms application uses the WebBrowser control to
open an Excel file since OLE objects are gone in .Net. The application
is actualy a clone of the one found in the MS Knowledge Base Article
"How to Use the WebBrowser Control to Open Office Documents with
Visual C# .NET" which can be found here:
http://support.microsoft.com/default...b;EN-US;304662

The application does what it's supposed to (ie Loads embeded Excel
and opens the file), the problem is that prior to that it displays a
"File Download" dialog. For personal use i could simply uncheck the
"always ask before opening this type of file" checkbox but for the
the release this is not an option.

I would like to know if it is possible to avoid the "File Download"
dialog.

Thanks in advance for any help.

Luis Ferrao


Jul 21 '05 #1
1 6422
To Avoid this you'll have to set the mime type of the stream for browser to "applicatio n/vnd.ms-excel"

HT
Sudhakar Sadasivun
Microsoft .NET MVP | MCA
http://weblogs.asp.net/ssadasivun
www.mugh.ne

----- Luis Ferrao wrote: ----

Hi

My Windows Forms application uses the WebBrowser control t
open an Excel file since OLE objects are gone in .Net. The applicatio
is actualy a clone of the one found in the MS Knowledge Base Articl
"How to Use the WebBrowser Control to Open Office Documents wit
Visual C# .NET" which can be found here
http://support.microsoft.com/default...kb;EN-US;30466

The application does what it's supposed to (ie Loads embeded Exce
and opens the file), the problem is that prior to that it displays
"File Download" dialog. For personal use i could simply uncheck th
"always ask before opening this type of file" checkbox but for th
the release this is not an option

I would like to know if it is possible to avoid the "File Download
dialog

Thanks in advance for any help

Luis Ferra

Jul 21 '05 #2

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

Similar topics

1
1823
by: bhavin | last post by:
I m using webbrowser control in my C# app. My system has IE 6.0. The application is crashing on other machine which has IE 5.0. Any idea why? Any kind of help will be a gr8 favor plz...........anyone. fast...!
0
1492
by: Luis | last post by:
Hi, My Windows Forms application uses the WebBrowser control to open an Excel file since OLE objects are gone in .Net. The application is actualy a clone of the one found in the MS Knowledge Base Article "How to Use the WebBrowser Control to Open Office Documents with Visual C# .NET" which can be found here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;304662 The application does what it's supposed to (ie Loads embeded Excel
2
18719
by: E Stafford | last post by:
I am creating a form app that uses a webBrowser control and allows users to interact with a web hosted application. Users can query the web app and generate a CSV file that they should be able to save locally. When the button to save the csv is hit on the page displayed in the webBrowser control, the CSV file generated by the app opened in a new webBrowser control and rendered as plain text with comma seperated format. How can I force...
2
3140
by: programmer2004 | last post by:
Hi I have used WebBrowser control and i want to save the entire webpage including pictures etc. i have called ExecWB method of WebBrowser control with OLECMDEXECOPT_DONTPROMPTUSER flag, but it opens save as dialog box. I want automatically save the webpage without using save as dialog box. "Is there any way of save as webpage?" regards
1
6881
by: Sameer | last post by:
Hi I have a windows form application and am using WebBrowser control to display a PDF document. The problem is that it will display the PDF file just fine however, when i try to delete the file it complains of Sharing violation as file is locked by Web Browser control. How do I release the file? Please help!
1
4493
by: JP2006 | last post by:
I'm trying to write a control that will take a screen capture of a particular website when a user submits a form in a web application; one of the form fields is for a URL - the control needs to get an image of that web site so that it can be displayed later as a thumbnail image. I have code for taking a normal screen capture using GDI+ which works fine. What I am now trying to do is to modify it so the screen capture is of a remote...
6
13705
by: Leon | last post by:
Hi there, I am trying to use the WebBrowser Control in a form which is being started in an own thread by the main form of my application. Unfortunately I am always getting an error in InitializeComponents stating that the ActiveX-Control 8856f961-340a-11d0-a96b-00c04fd705a2 cannot be initiated because the current thread isn't a single-thread apartment. Is there way of using the webbrowser control in multi threaded applications in .Net...
2
8633
by: Artie | last post by:
Hi, I have a WebBrowser control displaying some formatted HTML. I need to be able to save the formatted HTML to a file, using the common Windows 'Save As' dialog, and preferably be able to pre- populate the File Name for saving. What's the easiest way to achieve this?
0
1870
by: mahendravarma | last post by:
HI, For some reasons, i need to pop up a form containing webbrowser control using windows service. But when it is initializing the web browser control in the form, it is throwing an error in the stacktrace System.Threading.ThreadStateException: Could not instantiate ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' because the current thread is not in a single-threaded apartment. at System.Windows.Forms.AxHost..ctor(String...
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8172
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
8474
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
7158
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...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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.