473,408 Members | 2,839 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,408 software developers and data experts.

Start external process from ASP.Net

Hello:
I am currently having problems with an ASP.NET page...I've never
programmed in ASP or HTML so all of this is new to me.
I have a table that contains a list of files. The columns are a Document
Description, the Filename (with the application extension) of the document,
and a button that will say "View Document". When the user clicks on a
button, I have pull up the document in the application it belongs to. I will
need to pull up documents for Word, Excel, Project, etc....For example, if I
click a button to view an Excel document, I have to start Microsoft Excel
and pull that document up. I'm dynamically creating the table so I can't use
the <asp:button> tag in the aspx.vb file...or can you? How do I bind each
button to a separate document? Do I need <input type = button> instead? Is
there any way to do this?

This is what I currently have in the Form.aspx.vb file to define the button:

'add a button to the table cell
objCell.Text = "<input type='submit' name='btnView'
onClick='ViewDoc_Click()' value='View Document'>"

ViewDoc_Click( ) will go to the database and retrieve the full file path,
and then call another procedure to start the external application.

I'm new to ASP, HTML, & ASP.NET...any help would be greatly appreciated.

Thanks,
Kristina Foxwell
Nov 17 '05 #1
1 4262
Have each button go to a special download page. Pass the Image ID on the querystring, so it looks kind of like this: http://localhost/myproj/download.aspx?FileID=43

Then in your download.aspx have some code similar to this:
Dim dr As System.Data.SqlClient.SqlDataReader
Response.Clear

cmdGetFile.Parameters("@File_ID").Value = _ Request("FileID").ToString

dbConn.Open()

dr = cmdGetFile.ExecuteReader
If dr.Read Then

Response.ContentType = dr("ContentType").ToString

Response.OutputStream.Write(CType(dr("FileData"), Byte()), _

0, CInt(dr("FileSize")))

Else

Response.Write("File Not Found.")

End If

Here's more info:

http://www.aspnetpro.com/features/20...200307so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net

"Kristina Foxwell" <kf****@jcpenney.com> wrote in message news:O8**************@TK2MSFTNGP11.phx.gbl...
Hello:
I am currently having problems with an ASP.NET page...I've never
programmed in ASP or HTML so all of this is new to me.
I have a table that contains a list of files. The columns are a Document
Description, the Filename (with the application extension) of the document,
and a button that will say "View Document". When the user clicks on a
button, I have pull up the document in the application it belongs to. I will
need to pull up documents for Word, Excel, Project, etc....For example, if I
click a button to view an Excel document, I have to start Microsoft Excel
and pull that document up. I'm dynamically creating the table so I can't use
the <asp:button> tag in the aspx.vb file...or can you? How do I bind each
button to a separate document? Do I need <input type = button> instead? Is
there any way to do this?

This is what I currently have in the Form.aspx.vb file to define the button:

'add a button to the table cell
objCell.Text = "<input type='submit' name='btnView'
onClick='ViewDoc_Click()' value='View Document'>"

ViewDoc_Click( ) will go to the database and retrieve the full file path,
and then call another procedure to start the external application.

I'm new to ASP, HTML, & ASP.NET...any help would be greatly appreciated.

Thanks,
Kristina Foxwell

Nov 17 '05 #2

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

Similar topics

2
by: Slide-O-Mix | last post by:
I am using the Process class to run an external application from my application. The first time I call the .Start() method it takes several seconds for the process to actually start. Subsequent...
6
by: Dmitri Shvetsov | last post by:
Hi, Can I start an external process from the Web Service? I'm using a code, compiler keeps silence, compiles ok and starts the project. When I trace in Debugger it doesn't start an external...
3
by: R.A. | last post by:
Hi The application I am working on should start an external exe application and wait for its result. The external application is most likely not a .net app. How can I call the exe from c# code...
3
by: stephen | last post by:
when I try consuming this method the method just hangs, if I look at the processes I can see that the wscript is running but it just seems to hang. shouldn't this be fairly trivial calling an...
3
by: C Williams | last post by:
I am using Visual Studio 2003 and trying to use the "Start External Program" option to start Excel when I run the program. What happens is that Excel opens and then immediately closes. I know...
4
by: Paul | last post by:
Hi, I am trying to start a process hidden. My code: wordprocess = new System.Diagnostics.Process(); ; wordprocess.StartInfo = new System.Diagnostics.ProcessStartInfo(wcmd, args);...
5
by: Pierre | last post by:
Can someone set me straight on things to look out for in regards to being able to launch an external application from within an asp.net 2.0 web application please? I am using impersonation in...
2
by: holysmokes99 | last post by:
I am developing a component in .Net 1.1, and want to debug it using the "start external program" of the debugger in the IDE. The program I want to start references both 1.1 and 2.0 components. The...
1
by: cvairetti | last post by:
Hi, I just write an application in C# that show an interface with five button, each button starts an external application that it comes in front of the main C# application with focus on. When the...
0
by: mbailey | last post by:
I am new to VB.Net (Visual Studio 2005) and am encountering a problem calling an external exe file with two parameters. If I use the Run dialog box of the Windows Start menu and enter: "C:\Program...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...

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.