I have an asp.net web page that:
1. Shows a message
2. Posts back (using javascript)
3. Reads contents of a file
4. response.write the contents of the file to the browser
My issue is this: If a user hits this page and decides to save the
page for offline browsing, they are not saving the output of the
response.write, but instead the html that shows the message and calls
the refresh.
How can I allow the user to save the current content of the page,
without hitting the server again for the dynamically created content?
Thanks in advance,
Jay 3 1416
Interesting problem Jay. Haven't encountered that one before. I think the
problem is related to the fact that the page, after PostBack is a Form
results page (as far as the browser knows). So the browser requests the page
afresh. A possible workaround would be to put the contents of the file (a
text file?) into a Session variable, and create a second page that displays
the contents of the Session variable. Then Response.Redire ct to the second
page. This would enable the browser to make a fresh request for the second
page, which would then reload the text from the Session variable and display
it as you want it to be saved.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
<ja****@gmail.c om> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com... I have an asp.net web page that:
1. Shows a message 2. Posts back (using javascript) 3. Reads contents of a file 4. response.write the contents of the file to the browser
My issue is this: If a user hits this page and decides to save the page for offline browsing, they are not saving the output of the response.write, but instead the html that shows the message and calls the refresh.
How can I allow the user to save the current content of the page, without hitting the server again for the dynamically created content?
Thanks in advance,
Jay
Maybe you can use some code like this:
Response.Clear( )
Response.Conten tType = Whatever
Response.Writef ile("c:\whateve r.doc")
Response.AddHea der("Content-Disposition", _
"inline;filenam e=whatever.doc" )
Response.End()
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://SteveOrr.net
<ja****@gmail.c om> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com... I have an asp.net web page that:
1. Shows a message 2. Posts back (using javascript) 3. Reads contents of a file 4. response.write the contents of the file to the browser
My issue is this: If a user hits this page and decides to save the page for offline browsing, they are not saving the output of the response.write, but instead the html that shows the message and calls the refresh.
How can I allow the user to save the current content of the page, without hitting the server again for the dynamically created content?
Thanks in advance,
Jay
Right on Kevin! Worked like a charm. Thanks for your help. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: AaronV |
last post by:
I've seen a few sites that offer this, but I'm not sure how they do it.
It's a form button, that when pressed, prompts the use to download a
file. Like if I want my banking records, I select a date range and
press the button, and it compiles and sends me an excel doc right then.
What I'd like is to comile and deliver a file in that manner, without
saving the file to some directory and providing a link. Does anyone
know how this is done?...
|
by: James |
last post by:
Situation: I have a page, built using document.write(). When I hit
'save as', IE goes and saves the contents of 'about:blank' to that
file, rather than saving the HTML it's displaying in the window. Does
anyone know how to get around this?
|
by: Trevor Orton |
last post by:
Hello, I'm having a slight problem using the W3C html validator and I've
reviewed the FAQ's with no luck so hopefully someone here would be kind
enough to point me in the right direction.
I recently validated my site's css and the bulk of the html pages via the
W3C validator but was forced to use the file upload option because the
'Validate by URL' option returns the following error:
>>Sorry, I am unable to validate this document because...
|
by: Thaynann |
last post by:
I have an app that (at the moment) moves through files that are on a web
site, and deletes them, wat i want to do for the next stage, is to be able to
download each file before i delete it.
i have tried POSTin to be able to view the image, then saving it, but it
doesnt work, the problem i have is that all the files on the server have the
same name, which is
http://1.1.1.1/DH/repository/content.tif
and for me to be able to view one, i...
|
by: Clay Black |
last post by:
I need to find a way to save an HTML page to the IIS server. What I need is
to have a button that once it is clicked the current page being displayed is
saved to a location on the local IIS server. I know there are ways to go
and get a page, but this one would be dynamic and wouldn't be saved so I
would need to save it while it is still active or have it forwarded to an
asp.net page that will take the html code and save it to a file.
TIA...
| |
by: Brad |
last post by:
I have code which takes an image, uploaded from a web page, and saves it to
a database. Now I want to always resize an uploaded image before it is
saved to the database. My code to resize is below and of course it's not
working properly because my web page which displays the resulting image from
the database is not showing the image. I **think** the problem is in my
converting the bitmap back to a byte array. If I change my code back...
|
by: McKirahan |
last post by:
I am looking for feedback on an approach to using PHP.
Below is a stripped down version of a Home page: "index.php".
The content of the site is displayed in the middle of the page and
is "included" via "Page1.htm", "Page2.htm", or "Page3.htm".
The page to be "included" is specified via the QueryString
which is specified in the navigational hyper links;
for example, "index.php?Page1".
|
by: pbd22 |
last post by:
Hi.
This is just a disaster management question.
I am using XMLHTTP for the dynamic loading of content in a very
crucial area of my web site. Same as an IFrame, but using XMLHTTP and
a DIV. I got the core of the javascript from here:
http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
I noticed in the demo that sometimes the content takes a long
|
by: WebCM |
last post by:
We can do it in different ways. Configuration data are sent by POST.
Some of them should be parsed before saving to file.
Perhaps, I will use var_export(). However, how to do it best?
1. Without a class / function.
Fields names have no prefix and are equal to $cfg array's indexes.
<input name="option_name" />
In every file of options form (e.g. main options, content options, e-
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |