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 56545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:33:04+00:00 2026-05-10T17:33:04+00:00

I’m looking for some suggestions on how to go about this. Any input is

  • 0

I’m looking for some suggestions on how to go about this. Any input is appreciated!

Currently, I have an ASP.NET MVC application. On the client, I have a link with an ID of an XPS document. When the user clicks the link, they are taken to a page with details about the document. In addition to this information, I wish to display the document along side of this information, in the same page.

On the server side, once I have the ID, I can get the document, serialized as a byte array, from the database. The question is, what’s the best way to get that serialized document into the webpage?

I would SEVERELY prefer not having to drop that document into the file system and then munge together a file path. I would like to be able to stream the document to the browser as a content type of ‘application/vnd.ms-xpsdocument’.

I’ve tried using a web control to handle this (can’t write binary out), thought about creating a HTTP handler to do this (no idea where to start), and have fuddled around with a couple other ways to get the document stream to the browser.

In addition, there is also the question of how to embed the document in the web page. Do I use an EMBED tag? Or an Object? Or do I use an iframe and set the source to point to whatever delivers the document?

Again, I don’t expect a solution wrapped up in a bow. I’m looking for some advice on how to go about this. And, while this question is about xps documents, it applies to any application that streams a binary file that is to be hosted in a browser (PDFs, etc).


Okay, as for displaying in the browser, one word: Silverlight. That’s solved. I still have the issue of figuring out the best way to send it from the server to the browser.


Strike that. It appears Silverlight isn’t advanced enough to display an XPS document just quite yet. I’m thinking about an iframe pointing to a http handler now… The iframe works. Too bad it throws the entire thing down the pipe. I suppose I could always strip off the first page and send that puppy…


Wow. No need for a HTTP handler. A custom ActionResult in MVC is all you need. How friggen awesome is that?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T17:33:05+00:00Added an answer on May 10, 2026 at 5:33 pm

    I think the simplest way would be to provide the document as a link (target=’_blank’) from the details page. This has several advantages:

    • You don’t need to retrieve and stream the entire doc unless the user asks for it.
    • On my system at least IE is already registered as the default XPS viewer, so by giving the doc it’s own window you avoid the whole question of how to embed it.
    • It makes it simple to provide a streaming source for the document: just use an HTTP Handler with an ID for a query string parameter.

    Even if you don’t like that idea, definitely go with an HTTP Handler for transmitting document. It’s real simple to do: when you create a new HTTP Handler in Visual Studio it should give you a nice page with all the busy-work done already.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for suggestions for debugging... If you view this site in Firefox or
I have some data like this: 1 2 3 4 5 9 2 6
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I have a bunch of posts stored in text files formatted in yaml/textile (from

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.