HyperLinkField links to Excel files always open in Excel as Read-Only.

I have an ASP.net site on an IIS 6 server. On one page, I have a GridView containing a HyperLinkField. This field contains links that point to Excel files on the server, albeit on another drive. The links open properly in Excel when clicked, however the files aways open as Read-Only. I want these files to be writable after they open. The permissions on the directory containing the Excel files is set for full access to Everyone, including the IIS and ASPNET users. Also, when these files are browsed over the network (not via web broswer), they open properly (writable). Why are these files opening Read-Only from a browser?

0
daskrabs
5/14/2008 5:41:02 PM
asp.net.web-forms 93655 articles. 4 followers. Follow

2 Replies
561 Views

Similar Articles

[PageSpeed] 23

 Is the other directory where the excel files are stored mapped as a virtual directory within your app? If not, you can't link to them like this. You can only hyperlink to content which is directly accessible from the web. It may work when you try it locally, but as soon as you deploy the app to a server, and try to access the files, you will find that it fails, as the lonks will be pointing to local resources rather than valid urls.

If you want to store the files outside of your web app virtual directory structure, you could use linkbuttons instead, and then on postback read the contents of the selected file and write it to the response stream using the Response.TransmitFile method.


My Blog
0
booler
5/15/2008 10:06:47 AM

I am already using a virtual directory.

0
daskrabs
5/15/2008 1:02:56 PM
Reply:

Similar Artilces:

Reading Excel Files from a .Net Web Form
Hi, This might be a dumb question, but ... When reading an Excel file from a .Net Web Form, is it necessary to have Microsoft Excel actually installed on the client machine running the web form? Also, do the Excel files being read need to be saved as "values only" or can the values be extracted from a spreadsheet where the cells contain formulas? Thanks. -Wayne Hi, For the 1st part, Office is not necessary to be installed. But Download the Office XP PIAs and use them to develop Office XP solutions with Visual Studio .NET. For 2nd Part I think you need to use Values.Regar...

Reading in Excel file, Excel still open in Task Manager
Here's my code: using Microsoft.Office.Interop.Excel; /// string filename = @"C:\example3.xlsx"; object updateLinks = 0; object readOnly = true; object format = 5; object password = ""; object writeResPassword = ""; object ignoreReadOnlyRecommended = true; object origin = XlPlatform.xlWindows; object delimiter = ""; object editable = false; object notify = false; object converter = 0; object addToMRU = false; o...

Got error after open excel file from server..During Export Excel File
this error appears if you have tried to save a workbook on a drive and you do not have Modify and Delete permissions to the location where the file is being saved. It is also possible that another user has a read lock on the file.Excel saves a file using three steps (if the file already exists in the target location):Creates a temporary file with a randomly generated name, such as 4CCA4100.Deletes the original file.Renames the temporary file to the original file name.If Excel cannot delete the original file or cannot rename the temporary file, this error message appears.To temporarily work a...

Excel experts : Filling an complex Excel file and parsing a complex Excel file
I am stuck with below mentioned problem The requirement is that, we have Excel file template(.xls) which has Macros and most of the Worksheets are either hidden OR locked. When the end user clicks on a button to download it, follows modifications has to be done to the Excel sheet. Unlock the Excel worksheet, fill some data at certain cells and then lock it back Write some data into a hidden worksheet There are two options as far as I know Excel Interop/MICROSOFT Excel 11.0 Object Library  OLEDB Driver I cannot go with option 1 becaus...

How to open and read excel file
Dear All, How to open and read excel file using powerbuilder? Joe You can use OLE automation or you can use the Excel ODBC driver and load the file contents into a datawindow/datastore. -- <hopethishelps/> Roy Kiesler [TeamSybase] Sybase Developer Network -- http://sdn.sybase.com <Joe> wrote in message news:046DB21DCA1E3B2E004C26AE85256C13.004C26BC85256C13@webforums... > Dear All, > > How to open and read excel file using powerbuilder? > > Joe One method is through OLE automation. Check http://my.sybase.com/detail?id=47867 and ht...

Importing text file (possibly a excel file) via a web-form to a database.
Hey there - I'm sort of new to this and have a question - which in itself is probably easy, I'm just having trouble finding it. I need to import a text file - possibly later an excel file - into a SQL database via a web-form upload function. Can anyone point me in the right direction? A tutorial page that you know of or sample code, possibly? Any help would be appreciated. Thanks Hi, Take a look @ : - Reading a Delimited File Using ASP.Net and VB.Net - HTHK B ShajudeenAreYaar.comDubai, United Arab Emirates. That was perfect - thank you!...

Viewing excel files in .aspx page with excel form.How?
Hi I want to embed excel file with all sheets in a .aspx page. A user can see excel data with excel form. How can I do that? Thanks  Hi, Yes it is possible to viewing excel files in .aspx page. You need to do this using a datagirdview. Following link give you more details how you do that.Open Excel file from an .aspx page Hope this will helps.** Don't forget to mark as "ANSWER" if it's help for you **Profanity is the one language all programmers know best. Thanks.Md. Nazmul Ahsan...

How to open and read Excel 2007 file
Would you please tell me what component(s) do I need to add to my form to open and read Excel 2007 spreadsheet under C++ builder 2007 using VCL Thank you for your help MB ...

Saving Excel file to be opened read-only
I've written a program in C# that creates an Excel worksheet.  I want to make it so that when it opens, it can only be opened in read-only mode so that the file can't be locked on the network.  How can I accomplish this?  My current SaveAs function is as follows: WSC_oXL.DisplayAlerts = false; WSC_oXL.ActiveWorkbook.SaveAs(WSC_save_path, Excel.XlFileFormat.xlWorkbookNormal, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); WSC_oXL.DisplayAlerts = tru...

ADO.Net for Excel files
I wrote a windows form application in C# that uses ADO.Net to read from an Excel file. I receive xls files but have to manually save them as xlsx files because I can't get the program to read xls files (I get "External table is not in the expected format"). As an aside, for broadest .net compatibility, I set each of the Projects (which create assemblies/dlls) for the application to .net framework 2.0. I have 2 questions: 1. How can I get my program to read xls files when Excel 2007 is installed? 2. How can I support environments where Excel 2002 and Excel 2003 are installe...

How to open a Excel file in web page
Hi, I have a page and on that page is a Image button, when a user Clicks on the image button I want to open a Excel file. The Excel file already exists on the web server. My code follows as protected void btnView_Click(object sender, ImageClickEventArgs e) { string url="http://192.168.1.22/Test/sample.xls" ; Response.ContentType = "application/octet-stream"; Response.Write("window.open('" + url + "', 'mywindow','resizable= yes, scrollbars= yes,target=_blank');"); } Problem is when I click the button popup pa...

How to Read Excel File AT VB.NET
Hi anyone know how do i read excel file at VB.net & display the result in a label or something.. e.g i know cell A2 is a string of text - e.g Hello this is the P/L for the month  i want grab that and put in a label etc.Thanks , it would be good if can refer me to url on using Microsoft Excel Library Object & its coding to connect, close connection , grab data from cell and input back the data. Regards,Bao  My Anime Site My Quality Animes HR BLOG With the proper connection string (http://www.connectionstrings.com/?carrier=excel) you can query it like ...

Open grid with excel in web form
Hi. I builds some reports and show it to clients using excel. In fact I build a a datagrid , and then open it as excel on the page with this code: Response.Clear() Response.Buffer = True Response.ContentType = "application/vnd.ms-excel" Response.Charset = "" Response.AddHeader("Content-Disposition", "inline; filename=""ReportWizard.xls""") '''Response.ContentEncoding = System.Text.Encoding.UTF8 Me.EnableViewState = False Dim oStringWriter As New System.IO.StringWriter Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter) Me.dgResult.RenderControl(oHtmlTextWriter) ...

How to Dynamically open excel through IE without creating an excel file
Hi, Is there a way to open excel within Internet Explorer to show some data from database (Oracle),through excel without actually creating an excel file on the server in ASP.net,dynamically? Thanks, Girish. you can send html down to the client and then set the contenttype header to the excel. it needs to be atleast excel97 or higher to be able to interpret the html. Response.ContentType = "application/vnd.ms-excel" Response.AppendHeader("Content-Disposition", "filename=blah.xls;") Mike Banavige~~~~~~~~~~~~Need a site code sample in a differe...

Web resources about - HyperLinkField links to Excel files always open in Excel as Read-Only. - asp.net.web-forms

DevX Tip Bank - C++
Welcome to the DevX Tip Bank, where readers share their hard-learned, real-world workarounds and code tricks. With 10,000 tips from generous, ...

Resources last updated: 12/24/2015 5:54:59 AM