473,387 Members | 1,517 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,387 software developers and data experts.

Response.Redirect to a filepath

Hi,

I am creating a test web site that allows me to click a button which
redirects me to a file path. I implemented some code to attempt this
but I keep getting a blank page. How do I correctly redirect to a
file path?

The code I've tried is shown below:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Response.Redirect("file:///C:/", False)
End Sub
Thank you

May 22 '07 #1
1 4780
Not sure what you are trying to do ? Also AFAIK most browsers won't let a
web site to direct the browser to a local resource (at least with the
default security settings)...
See for example the note on
http://msdn2.microsoft.com/en-us/library/aa767731.aspx (documentation for
the file protocol).

--
Patrice

<ma******@gmail.coma écrit dans le message de news:
11**********************@u36g2000prd.googlegroups. com...
Hi,

I am creating a test web site that allows me to click a button which
redirects me to a file path. I implemented some code to attempt this
but I keep getting a blank page. How do I correctly redirect to a
file path?

The code I've tried is shown below:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Response.Redirect("file:///C:/", False)
End Sub
Thank you

May 22 '07 #2

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

Similar topics

6
by: Mark Sargent | last post by:
Hi All, been away from developing, if you can call what I do that, and am stumped already..lol..see code below. I'm trying to get each row to display, based on the if statements. Hope you can...
0
by: Earl Teigrob | last post by:
I have a datagrid with a download button that raises the itemcommand event. In the event handler for this event, I have the code below. The problem is that the download code requires a...
3
by: Jed | last post by:
I have written an HttpHandler which I invoke through an ashx page. The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page. Everything...
3
by: Lars Netzel | last post by:
I want to press a Linkbutton (in a DatagridItem) and return a file that is not shared in the IIS. I want to disallow "deeplinking". The following code works fine (it sends the file I want) but I...
6
by: john | last post by:
The standard method to transmit a file from an aspx page to a browser is to stream the file to the response then end the response. The HTML code generated by the aspx page is discarded, and the...
1
by: Cindy H | last post by:
Hi I used the code below to automatically open a pdf file when the user clicks on a menu option. It works great on local machine, but when I uploaded it to hosting site and then tried it, I...
1
by: ChristopherABurns | last post by:
I have a very simple code snippet here: private void Page_Load(object sender, System.EventArgs e) { string filePath = Server.MapPath("\\Transcriber\\TranscriberTest\\"); string fileName =...
1
by: =?Utf-8?B?V29vZGdub21l?= | last post by:
Hi, I have use the following code to transmit a file back to the browser that worked fine on a HTC_TTyN device running windows mobile 5.0. The code executes in the onclick event of a mobilelist...
0
by: Nathan Sokalski | last post by:
I am using an *.aspx page with a querystring to access graphics that I am using in rollovers. I am using Response.ContentType and using Response.WriteFile(). This sends the graphic perfectly fine,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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
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...

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.