Open PDF File On Button Click Or Hyperlink

Feb 14, 2008

I want to open a .PDF file on button click or hyperlink.

View 19 Replies

Similar Messages:

Web Forms :: How To Open A Text/pdf/mp3 File On Hyperlink Click From A Aspx Page

Jan 29, 2010

i have a fileupload control which i use to upload file to the server. after the upload is successful i enable a hyperlink with the name of the uploaded file.

i want the user to be able to view this file in the browser after the file has been uploaded.

i did try assigning the navigateurl for the hyperlink = HttpContext.Current.Request.MapPath(".") + "\folder1\" + fileName;

which dint work. all uploaded files are being stored in a folder inside my solution directory on the server.

View 7 Replies

Cannot Open File When Click Open Button In File Download Dialog?

Aug 3, 2009

I annot open text file when click open button in File Download dialog.

the error message as bellow:

Cannot find the C:Documents and SettingspbtLocal SettingsTemporary Internet FilesContent.IE5GPINOXUBSPE1O0701Exception[1].txt file.

Do you want to create a new file?
Yes No Cancel

View 3 Replies

On User Click Open Button It Should Open Txt File?

Nov 12, 2010

When the user clicks on "OPEN" button, It should open up that(.txt) file which is on the file server in ReadWrite Mode (like in notepad) without any Access Issues.

Or simply has to be openend as temporary READONLY .Txt File. So that the user can close after viewing it.

View 8 Replies

Forms Data Controls :: Save/open File From Hyperlink Or Button Press?

Dec 12, 2007

Problem: my templatefield buttons will not save/open my files. Also, I tried a hyperlink instead of the buttons and I couldn't get the navigateURL to show properly.

I am listing the contents of a folder by using a directoryinfo object, and binding it to a gridview. I then have added a template field with two button controls in it ("save" and "open"). I want to be able to list all the file names on the left side of the grid, and a link to download/save/open the file on the right. Since I want this all to be dynamically driven, I have to find a way to use my codebehind to determine the proper file url for opening, and not hardcode any values. This is as far as I have gotten. I am not sure what is the easiest way to do what I want to achieve...

I wrote a small sub procedure to fire off when a button is clicked, but I cannot debug it because the button click wants to make the page postback. I cannot figure out how to force this option off. Basically it the logic was directed at the "fullname" which is the physical file path, and the commandname from the button and then uses that to determine the path for opening the file.

I was also experimenting with a asp:hyperlink trying to set the navigateURL='<%# eval("fullname") %>' which logically makes sense...but when rendered to the client it shows the link as "file://C:mantissadocumentationfile.doc", and clicking that file does nothing in IE and causes an error in Firefox saying it cannot associate a known protocol with it.

I have seen a few different articles through searching that show some of the functionality I need, but no example is fully dynamic like I need. I'm still an novice asp developer, so I am not sure how to achieve the end result I want from the options available. I would *like* to keep it simple and just use a hyperlink and magically have that hyperlink wired up to the actual file. I do not wish to embed my "files" inside my pages, I only want them to open as a new window. The extensions mainly handled here will be .doc, .txt, and .pdf. I read about using response.addheader("content-disposition", etc) to prompt with a save/open dialog box...but again I am not sure how to pass all the variables to make it fully dynamic.


My code still has bits and fragments of all the different things I have attempted to use to make it work.



View 6 Replies

Web Forms :: Open Pdf File On Button Click?

Nov 12, 2009

It seems like this shouldn't be as trivial as I'm finding it to be, but I am trying to open a pdf file that gets generated on Page_Load() and saved to a directory. So I have the file path and I just need to know how to open the file.

I'm using VS2008, C#.

View 3 Replies

How To Have One Button Click That Does Multiple Events / Won't Open The Second File

Jul 1, 2009

I thought mine was working, but now on the button click, it will only do one or the other of my excel open calls. Am I doing something wrong here? It will not post an error or anything, just won't open the second file.


View 4 Replies

Open File Dialog On Click Of A Button Without Using FileUpload Control?

Sep 7, 2010

I want to open file dialog on click of a button in without using file upload control.

View 2 Replies

Change From A Button To A Hyperlink Control - Attach Click Event? "asp:button => Asp:hyperlink"

Mar 31, 2009

Because of css I want to change from a button to a hyperlink control. I have one problem: How to attach the click event? I get following error: Click is undefined

View 5 Replies

Web Forms :: Open An Excel File Created In The Root Folder In A Button Click?

Oct 6, 2010

I have an excel file created at this link:

<a href=""Exports/" & fileName & """></a>

how to open it in a button click, using / as codebehind.

View 3 Replies

Web Forms :: Open File Dailogue Box On Click Event Of Simple Button Like Gmail?

Dec 17, 2008

i have some specific requirement.. i have a application in which i have to give the functionality to user that he can upload his image on server but in a manner given below..

1. There is a simple button on the form , when user click that button OPEN FILE DIALOGUE BOX should be open directly.(please mind it that FILE UPLOAD CONTROL should not be used here)

2. As soon as user click the OPEN Button of the OPEN FILE DIALOGUE BOX image should be appear on the form..

View 3 Replies

Web Forms :: On A Button Click .aspx Page Open New Window Retrieving Data From Another Xml File

Feb 2, 2011

I am using VS 2005.An 1.aspx page is there, retrieving data from an xml file and having a button.On a button click same 1.aspx page should open new window retrieving data from another xml file with the help of query string.

View 3 Replies

Web Forms :: How To Open Microsoft Office Word File From A Button Click In Aspx Page Using C#

May 11, 2010

i have an aspx page with one button on it the name of the page is Default.aspx

i have a physical microsoft office word file in the c drive

what i want to do is that when i press a button i open a microsoft office word located on the c drive then i add some text to it using c# code

then i want to open the file (that i edited and located in memory) in mircosoft office word to see the text that i have added

everything works fine but when i press the button i get a prompt that says do you want to open the file or save it .


so how can i directly open the file (located in memory) in microsoft office word without this prompt

also if i choose open from the prompt the file opens in the read only mode and the title of the file in the microsoft word become the name of the aspx page which is Default.aspx

so what is going wrong here


View 2 Replies

Web Forms :: Check Which Button User Click When Downloading File, Either Open, Save Or Cancel?

Oct 22, 2010

i am new to this, would like to ask how can i check which button user click when downloading file, either open, save or cancel ? I need to update to the Database after the user click the save/open button, if cancel, then do not do anythinghere is example of code:

void Page_Load(object sender, EventArgs e) {

View 9 Replies

How To Open XML File From A ASP Hyperlink Control

Sep 23, 2010

How can I open a XML file from the location mentioned in the web.config file using Hyperlink control?

I have an aspx page with hyperlink control and in code behind I do the following:

hypLink.Text = "Transformed XML";
hypLink.NavigateUrl = ConfigurationSettings.AppSettings["OutputXML"];
web.config looks like:
<add key="OutputXML" value="C:WorkingMyTestXMLTransformApp_DataTransformed.xml"/>

This code is not working. In IE, it doesn't do anything but in FF, it throws a error box with message that the "FF doesn't know how to open this address..."

View 2 Replies

Using Dreamweaver Cs4 And Want To Hyperlink It To An Other Page Using The On Click Of The Button?

Apr 10, 2010

i am using dreamweaver cs4 and want to hyperlink it to an other page using the on click of the button.

View 3 Replies

Forms Data Controls :: Button In Web Form / Click Button It Will Open Popup Box Along With Download Dialog Box?

Jan 16, 2011

i have a web form in which i ve a button which will open a sliding pop up box(jquery) on click of it. In the same page i ve also a linkbutton for downloading files. Now the problem is first time wen i click that button it does nothing. (will not open popup box). Once i click on download button and then if i click that button it will open popup box along with download dialog box. Why is it happening so... is it because am using same event click for both these.

but download option is implemented in gridview_rowcommand()..

View 2 Replies

Web Forms :: Open XML File From Hyperlink Control?

Sep 23, 2010

How can I open a XML file from the location mentioned in the web.config file using Hyperlink control?

I have an aspx page with hyperlink control and in code behind I do the following:


Web.config file looks like:


This code is not working. In IE, it doesn't do anything but in FF, it throws a error box with message that the "FF doesn't know how to open this address..."

View 3 Replies

Web Forms :: Getting Hyperlink To Respond Like A Button Click Event?

Aug 9, 2010

I have some dynamically-changing text, which I would like to appear as a hyperlink (i.e. underlined text which changes colour as you hover the mouse over it). However, I would also like this text to behave like an asp:Button object when the user clicks on it. This is so I can add some VB.NET into the click event of the text. Does anyone know how I can do this?

View 9 Replies

Web Forms :: Open One Document File By Clicking On Hyperlink On Webpage?

Mar 29, 2011

in my web application i am trying to open one document file by clicking on hyperlink on webpage,

when i run the appication open the that page click on the link file gets open.

but, when i run the application through iis, when clicking on that link file not found alert comes.

that document file present in separate fileserver.

View 2 Replies

How To Open A Dialog Box(Open , Save And Cancel Button) To Download That File (.zip And .Exe)

Dec 3, 2008

I am using 3.5 I wan to show File Download dialog box when user click on button control Then show File Download dialog(Open , save and Cancel button) to download that file.

This works for .zip and .exe files.

View 4 Replies

Web Forms :: Download Pdf File In Application On Click On A HyperLink?

Nov 3, 2009

I have a pdf file that is stored in my Application folder . i.e "~/pdfs/MyPDF.pdf" I have a Hyperlink control on my form. On click of the Hyperlink , I need to be able to download the file or open the pdf in a new browser window.

View 7 Replies

Open Web Form On Button Click?

Mar 9, 2009

I have just started ASP.NET 2.0 and VB and just wondered how you create links between pages when a button is clicked. I have a button on the page entitled 'index' and I want the site to go to the page 'links' when this is clicked. Any ideas? I am using Visual Web Developer 2008.Does anyone recommend any book for people starting out with ASP.NET and VB.NET?

View 7 Replies

How To Open A Pop Up Window On Button Click

Jul 3, 2010

As i am new to coding, what i was doin is i want to open a pop up window on button click in my default.aspx page.

and when the child window opens, it contains the grid view where we can select the relevant information and we hav to send this to the parent window

everything is working fine,but when we send the values to the parent page, all the text boxes and controls in the parent page are getting refreshed. and its being a problem, that the user has to re enter the data.

here is my code


View 5 Replies

Open A PDF On Image Button Click?

Apr 15, 2009

I have an ASP Image Button and when clicked I'd like it to open a PDF in a new window. The PDF is stored in the project folder.

View 2 Replies

Open Several New Pages On Button Click?

Sep 14, 2009

I have a situation on which i want to open several pages on one button click

i has three checkboxes and one button ...for every checkbox i choose i have to open a new page when i click the button there a way i can do such an approach ?

View 8 Replies

Click A Button To Open Page?

Jul 14, 2009

I don't need to say I am at the begining, therefore In VS2008 (VB) I want to click a button, do some code and depending on the code call a new page in the same browser (do not open another window).How do I call a new page (xxx.aspx

View 3 Replies

Open A Page On Click Of A Button?

Dec 16, 2009

I'm fiddling with the code below. I think it's close, but still not working yet:

<asp:Button runat="server"
OnClientClick="'GoogleMaps.aspx', 'popupwindow', ',+New+York,+NY+10003-2736+(Professor+Thom%27s)&daddr=225+West+4th+Street,+New+York,+NY+10014-3147+(Riviera+Cafe)+to:337+3+Avenue,+New+York,+NY+10010-2341+(Hairy+Monk)+to:1701+2+Avenue,+New+York,+NY+10128-3276+(Pat+O%27Briens)
', width=600,height=500,scrollbars,resizable')" Text="See it on Google Maps"
value="enter" />

I keep getting an error that says:

Control 'ctl00_ContentPlaceHolder1_Button1' of type 'Button' must be placed inside a form tag with runat=server.

View 8 Replies

File Upload And Retrieving The Files On Click Of A Hyperlink In Gridview?

Jan 12, 2010

I'm using a file upload control to save the documnets ina file server and i'm storing the url for the docs in database.

In a grid i'm binding the url to a hyperlink field. But the link is not working. The document is not openeing. Is this the correct way to do?

If the file is stored in a local machine it is openeing but if i store it in some fileserver it is unable to open.

View 1 Replies

After Click Link Button Its Not Open Popup?

Jul 17, 2009

i have bind a repeater control and there a link button i click Link button its not open popup when i click again then its open the popup.

View 6 Replies

Copyrights 2005-15, All rights reserved