Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6773617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:41:22+00:00 2026-05-26T15:41:22+00:00

I would like to change the page title for the openned window when a

  • 0

I would like to change the “page title” for the openned window when a user views an ashx file in the browser. Users click on a document which will open in a new tab in the browser, and the document is shown (i.e. Word, Excel, PDF, etc.). What happens now, is that the page title shows something like “file.ashx?id=5” when I would rather the title show something like “New Document.pdf” or just “New Document” instead of showing the url of the ashx file.

I have looked into setting the filename through a header, that does work, but the file is downloaded instead of simply openning in the broser window. That is not the desired behavior I was going for.

I understand that this may not be possible, but thought I’d check anyway.

Thanks for the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:41:23+00:00Added an answer on May 26, 2026 at 3:41 pm

    For the title of the page: I can only speak to Internet Explorer, but when you show a new window, Internet Explorer requires that the title bar always be displayed (see the MSDN Article About Window Restrictions for more details). The problem when viewing files inline is that you do not send any HTML back to the page so there is no way through this method to have the title change.

    I know that we did experiment with several different approaches, but decided that for our user base, it was ok to not have a user-readable value in the title bar. If this is important to you, then I think your only real option would be a frame-based solution where your ashx page is embedded in a frame (or iframe) and the title page is controlled by content in a different frame (or portion of the page in the event you use an iframe).

    To view the file in the browser instead of having it downloaded: you need to set the Response ContentType to the appropriate MimeType for the file (i.e. “application/pdf” for PDF files) and add a Content-Disposition header that specifies the file is to be opened inline and the file name for the user. You should also ensure that other content and headers are cleared from the response.

    this.Context.Response.ClearContent();
    this.Context.Response.ClearHeaders();
    this.Context.Response.ContentType = "application/pdf";
    this.Context.Response.AddHeader("Content-Disposition", "inline; filename=mytest.pdf");
    this.Context.Response.TransmitFile(sLocalFileName);
    this.Context.Response.Flush();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to be able to change the page title with PHP. Now
I would like to change the page names of a ASP.NET site to make
i would like to have a page where i can change passwords. me should
I would like to change this: // use appropiate lang.xx.php file according to the
I would like to change the logged in user to another user temporarily to
http://www.sitefinity.com/devnet/forums/sitefinity/developing-with-sitefinity/override-how-page-title-is-generated.aspx#2050837 I would like to override how the page titles for all pages on
Using Javascript, I would like change the background color of the numbers in an
I would like to change visual studio's default configurations (Debug,Release). That is, change the
I would like to change the target of symbolic link from within a bash
I would like to change a program to automatically detect whether a terminal is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.