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

Q: Response.Write

Hello,
I use this:
Response.Redirect("/Files/myFile.xls") which is working fine but shows
address bar and I am trying to get rid of it.

So if I have the following, will this let me see excel file? If yes, can you
complete Response.Write?

Dim fileAndPath as string
fileAndPath = DD.SelectedItem.Value ‘ this has mFile.xls
‘Response.Redirect("/Files/” & fileAndPath) change this to ….
Response.Write(" <script> window.open(“???”) </script> ")
Thanks,
Jim.
Nov 19 '05 #1
4 3858
I suggest you use the Response.WriteFile method instead.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
Hello,
I use this:
Response.Redirect("/Files/myFile.xls") which is working fine but shows
address bar and I am trying to get rid of it.

So if I have the following, will this let me see excel file? If yes, can
you
complete Response.Write?

Dim fileAndPath as string
fileAndPath = DD.SelectedItem.Value ' this has mFile.xls
'Response.Redirect("/Files/" & fileAndPath) change this to ..
Response.Write(" <script> window.open("???") </script> ")
Thanks,
Jim.

Nov 19 '05 #2
I could not believe that this is really this difficult and takes this much
time. Response.WriteFile could not replace Response.Redirect unless you do
many other things.

Here is part of my code.

Response.Clear()
Response.ContentType = "Application/x-msexcel"
Response.WriteFile("D:\Files\myFile.xls")
Response.End()

This tries to open my main.aspx and ends up saying: the file referenced by
shortcut file “a file name in the temporary internet files folder” can not
be opened.
Any idea?


"Steve C. Orr [MVP, MCSD]" wrote:
I suggest you use the Response.WriteFile method instead.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
Hello,
I use this:
Response.Redirect("/Files/myFile.xls") which is working fine but shows
address bar and I am trying to get rid of it.

So if I have the following, will this let me see excel file? If yes, can
you
complete Response.Write?

Dim fileAndPath as string
fileAndPath = DD.SelectedItem.Value ' this has mFile.xls
'Response.Redirect("/Files/" & fileAndPath) change this to ..
Response.Write(" <script> window.open("???") </script> ")
Thanks,
Jim.


Nov 19 '05 #3
I think I solved this. thanks.

"JIM.H." wrote:
I could not believe that this is really this difficult and takes this much
time. Response.WriteFile could not replace Response.Redirect unless you do
many other things.

Here is part of my code.

Response.Clear()
Response.ContentType = "Application/x-msexcel"
Response.WriteFile("D:\Files\myFile.xls")
Response.End()

This tries to open my main.aspx and ends up saying: the file referenced by
shortcut file “a file name in the temporary internet files folder” can not
be opened.
Any idea?


"Steve C. Orr [MVP, MCSD]" wrote:
I suggest you use the Response.WriteFile method instead.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
Hello,
I use this:
Response.Redirect("/Files/myFile.xls") which is working fine but shows
address bar and I am trying to get rid of it.

So if I have the following, will this let me see excel file? If yes, can
you
complete Response.Write?

Dim fileAndPath as string
fileAndPath = DD.SelectedItem.Value ' this has mFile.xls
'Response.Redirect("/Files/" & fileAndPath) change this to ..
Response.Write(" <script> window.open("???") </script> ")
Thanks,
Jim.


Nov 19 '05 #4
Since you posted the same question twice and got good help both time, it
would be kind of you to post the final solution so that it might help others
and help us whom tried to help you better help others in the future :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
I think I solved this. thanks.

"JIM.H." wrote:
I could not believe that this is really this difficult and takes this much time. Response.WriteFile could not replace Response.Redirect unless you do many other things.

Here is part of my code.

Response.Clear()
Response.ContentType = "Application/x-msexcel"
Response.WriteFile("D:\Files\myFile.xls")
Response.End()

This tries to open my main.aspx and ends up saying: the file referenced by shortcut file "a file name in the temporary internet files folder" can not be opened.
Any idea?


"Steve C. Orr [MVP, MCSD]" wrote:
I suggest you use the Response.WriteFile method instead.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
> Hello,
> I use this:
> Response.Redirect("/Files/myFile.xls") which is working fine but shows > address bar and I am trying to get rid of it.
>
> So if I have the following, will this let me see excel file? If yes, can > you
> complete Response.Write?
>
> Dim fileAndPath as string
> fileAndPath = DD.SelectedItem.Value ' this has mFile.xls
> 'Response.Redirect("/Files/" & fileAndPath) change this to ..
> Response.Write(" <script> window.open("???") </script> ")
>
>
> Thanks,
> Jim.
>
>

Nov 19 '05 #5

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

Similar topics

9
by: Ricardo | last post by:
Hi. How should I pass a " (doble-quote) character to response.write() in order for it to be sent to the output ? Thanks in advance for the help.
0
by: Copa | last post by:
Hello, I am testing buffering an asp page and Flushing information out to the browser, hence i wrote the code in an asp page that follows this Message Post. The loops are suppose to simulate...
2
by: Rob McLennan - ZETLAND | last post by:
Hi, I'm relatively clueless when it comes to correct ASP syntax. I'm testing out a search form for my company's website which is done in ASP. The results are displayed as per the code shown at the...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
9
by: Dominic Godin | last post by:
Hi, I have an asp page that does a lot of processing and reports it's finished by printing the word "Success". For example: <% SomeFunction(SomeVar) SomeFunction(SomeVar1) ...
13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
5
by: Luiz Vianna | last post by:
Guys, I need to send some info to my client while I'm processing some stuff. The flow will be something like : -process -response -process -response .... I imagine to use response.flush...
0
by: jose.mendez22 | last post by:
I'm trying to fire a pop-up window before I execute a lengthy stored procedure so I may utilize this window as a status window on number of records executed. After my response.write statements...
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...
4
by: cbtechlists | last post by:
I have an ASP app that we've moved from a Windows 2000 to a Windows 2003 server (sql server 2000 to sql server 2005). The job runs fine on the old servers. Part of the app takes a recordset and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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...

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.