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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:51:36+00:00 2026-06-02T18:51:36+00:00

I am trying to show a downloadable link on my MVC application’s View using

  • 0

I am trying to show a downloadable link on my MVC application’s View using ActionLink:

<div>
<%= Html.ActionLink("Test","Download","Admin") %>
</div>

public ActionResult Download()
{   
    var cd = new System.Net.Mime.ContentDisposition
    {        
        FileName = "Download Me", 
        Inline = false, 
    };
    Response.AppendHeader("Content-Disposition", cd.ToString());
    byte[] csvBytes = Encoding.ASCII.GetBytes("hello");
    return File(csvBytes, "csv","DownloadMe.csv");
}

The link shows up on the UI but when I click on it, I get an “Endpoint not found” error.
I am new to MVC and trying this out for the first time. Can someone please 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-06-02T18:51:38+00:00Added an answer on June 2, 2026 at 6:51 pm

    I think you have a few issues with the controller method:

    public FileResult Download()
    {
        byte[] csvBytes = Encoding.ASCII.GetBytes("hello");
        return File(csvBytes, "text/csv","DownloadMe.csv");
    } 
    
    1. You want to return a FileResult, not an ActionResult.
    2. The mime type is text/csv rather than just csv.
    3. I don’t think the content disposition is required, but I would take it out until you get it working and then add it back later if necessary.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to show/hide a div using jquery when a link gets clicked. I
I'm trying to download a directory, using FTP in a C# application. I basically
I am trying to download files using NSURLConnection and show the download progress. But
Trying to show/hide severals divs using jquery after each news on my page. <div
I'm trying to show thumbnail images in Django admin, but I can only see
Ok I am trying to show a number using a series of Images. eg.
I am trying to show detailed UItable view when clicking on row. I used
I'm trying to show an intercept on a line graph using the ggplot vline
I am trying to show up some HTML Special Chars like ☚ and I
I am simply trying to show detail view page from table page I have

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.