I am trying to re-work a Visual Basic (ASP .NET 2.0) application that delivers a PDF to a user based on requests. I have the appropriate MIME type (Application/pdf) specified but need to open the pdf in a new browser window. Any ideas? I appreciate any and all input
Thanks
4 1498 kadghar 1,295
Recognized Expert Top Contributor
I am trying to re-work a Visual Basic (ASP .NET 2.0) application that delivers a PDF to a user based on requests. I have the appropriate MIME type (Application/pdf) specified but need to open the pdf in a new browser window. Any ideas? I appreciate any and all input
Thanks
i dont know if this works with .net, but with vb and vba i use shellexecute: - 'To declare it, copy and paste this:
-
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
-
-
'To use it, this lines would do for a pdf:
-
-
a = ShellExecute 0, vbNullString, path & "file.pdf", vbNullString, vbNullString, vbNormalFocus
-
'Dont forget to declare variables
-
Hope that helps
i dont know if this works with .net, but with vb and vba i use shellexecute: - 'To declare it, copy and paste this:
-
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
-
-
'To use it, this lines would do for a pdf:
-
-
a = ShellExecute 0, vbNullString, path & "file.pdf", vbNullString, vbNullString, vbNormalFocus
-
'Dont forget to declare variables
-
Hope that helps
Thanks .... will work with it over the weekend !
Thanks .... will work with it over the weekend !
-
Partial Class _Default
-
Inherits System.Web.UI.Page
-
'To declare it, copy and paste this:
-
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
-
-
'To use it, this lines would do for a pdf:
-
-
Dim path As String = "C:\"
-
-
a = ShellExecute 0, vbNullString, path & "test.pdf", vbNullString, vbNullString, vbNormalFocus
-
-
End Class
-
I tried the above code .. received a 'declaration expected' message .. I feel stupid ... sure it's something that I am not seeing clearly ... :(
kadghar 1,295
Recognized Expert Top Contributor
Try declaring the function outside the class (before it starts)
I really dont know if shellexecute works the same way with .net, so may be thats the problem.
Good Luck
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Hemanth |
last post by:
Hello there,
I've a utility that runs on a linux machine. Basically, it opens
a window, draws a figure and captures the image (screen) and stores
it as a jpeg file. The utility requires a...
|
by: Bob |
last post by:
I am pretty new at C#, so bare with me. I want to be able to read a local HTML file and display it in a browser window within my application. I also want to submit that page to my application and...
|
by: VMI |
last post by:
In my web app, how can I display an XML file in another browser window? Can
this be done with C#?
Thanks.
|
by: Tina |
last post by:
I'm in a button clicked event on mainpage.aspx. I want to display a new
webpage that has just my image, which is a jpg. I want the page to be a
..jpg not an aspx so that it will be easy for the...
|
by: chazmanian |
last post by:
We have a situation where we display PDF files through IE via a method in our code-behind as follows
protected void displayPDF(string exePath, string filePath
{
// exePath is the...
| |
by: acool |
last post by:
I just plain forgot this setting and I have been all up and down the options
and nothing works, any hel is appreciated.
|
by: David Cho |
last post by:
I hope I can describe the dilemma precisely.
I have code to render PDF output in a browser window (using a third
party control that merges PDF files and renders the PDF output in the
browser...
|
by: tshad |
last post by:
This was posted before but the message got messed up (all NLs were stripped
out for some reason).
I have 2 labels that hold the name of different images on my .aspx page.
<asp:Label ID="Logo"...
|
by: Safalra (Stephen Morley) |
last post by:
(Note: I'm not trying to do anything stupid based on the user's screen size
- I'm just curious.)
At work today I was looking at the visitor statistics for a client website,
and noticed that...
|
by: H. Rodriguez |
last post by:
Hello,
I would like to be able to open a new IE window on the client side and
display a PDF document in the new window. Many tutorial sites that I have
checked suggest opening a new IE window...
|
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,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |