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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:02:16+00:00 2026-05-23T14:02:16+00:00

I need to pass an image (currently a byte stream) to a Java Applet

  • 0

I need to pass an image (currently a byte stream) to a Java Applet in an ASP MVC 3.0 web site.

The docs for the applet says the file can be generated dynamically by a HTTP GET.

What should the Controller action that gets the dynamic content return?
Also, how do I specify the Url in the Html for the applet?

I’ve tried returning a File result from the controller, and embedding a “Html.RenderAction” call where the file name should go, but I get this error (on the Html fragment included below)

CS1502: The best overloaded method match for
‘System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)’
has some invalid arguments

HTML fragment

<param name="Filename" value="@Html.RenderAction("DownLoadImage", "Document", new { DocumentId = Model.DocumentId, Page = Model.Page })">

Controller Action

public ActionResult DownloadImage(string DocumentId, int PageNo)
{
    byte[] bytes = documentProvider.GetImage(DocumentId, PageNo);
    return File(bytes, "image/tiff");
}

The DownloadImage action works when I use it in a “download image” ActionLink.

Please let me know if you need anything else.

Apologies if I’m doing something dumb, or missing something very obvious. I know very little about Web Development, this is my first ASP MVC application, and the first time I’ve used a Java Applet . . . please be gentle

Thanks.

  • 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-23T14:02:17+00:00Added an answer on May 23, 2026 at 2:02 pm

    The synatx error is from Razor — it renders differently than the old WebForms viewmodels which is used the Writer. But that is a bit of a red herring here — you actually don’t want to do it this way anyhow — this is trying to drop the bytes of image data you are streaming into the HTML.

    What I think you want to do is pass the applet a URL to the controller action that is rendering the image. It will read it off the wire then do it’s thing. Your code should probably look like:

    <param name="Filename" value="@Url.Action("DownLoadImage", "Document", new { DocumentId = Model.DocumentId, Page = Model.Page })">
    

    Have no seat time with the applet so I’m not sure if that will do the trick. You might need to make it an absolute URI, or you might have some challenges with authentication depending on how things work under the hood.

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

Sidebar

Related Questions

I need to pass multiple parameters dynamically to my ascx file through the image
I need to pass an ID and a password to a batch file at
I need to increase my PermGen. Currently I pass the following as command line
I've been playing around with ASP.NET MVC with a site containing a Master Page.
in my rails app, I need to pass back a image. I have a
On my asp.net mvc page I need to render multiple images that are stored
I need to pass a regex substitution as a variable: sub proc { my
I need to pass an array from JavaScript to a page method in C#.
I need to pass a pointer through a scripting language which just has a
I need to pass audio data into a 3rd party system as a 16bit

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.