HttpResponse.TransmitFile Method (BUT for multiple files)?Return multiple files to download from asp.netCreate Generic method constraining T to an EnumCatch multiple exceptions at once?How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do I use reflection to call a generic method?Why is it important to override GetHashCode when Equals method is overridden?How to mark a method as obsolete or deprecated?File Upload ASP.NET MVC 3.0How to call asynchronous method from synchronous method in C#?C# classes - basic exampleHow to serve static files in Flask

How to have a sharp product image?

As an international instructor, should I openly talk about my accent?

Function pointer with named arguments?

Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?

How to limit Drive Letters Windows assigns to new removable USB drives

How to prevent z-fighting in OpenSCAD?

Don’t seats that recline flat defeat the purpose of having seatbelts?

Can SQL Server create collisions in system generated constraint names?

Is it idiomatic to construct against `this`

Which big number is bigger?

How could Tony Stark make this in Endgame?

Extension of 2-adic valuation to the real numbers

How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?

Is there any official lore on the Far Realm?

Map of water taps to fill bottles

How can I practically buy stocks?

Like totally amazing interchangeable sister outfits II: The Revenge

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

Why does nature favour the Laplacian?

bldc motor, esc and battery draw, nominal vs peak

"You've called the wrong number" or "You called the wrong number"

Does a large simulator bay have standard public address announcements?

What does ゆーか mean?

Classification of surfaces



HttpResponse.TransmitFile Method (BUT for multiple files)?


Return multiple files to download from asp.netCreate Generic method constraining T to an EnumCatch multiple exceptions at once?How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do I use reflection to call a generic method?Why is it important to override GetHashCode when Equals method is overridden?How to mark a method as obsolete or deprecated?File Upload ASP.NET MVC 3.0How to call asynchronous method from synchronous method in C#?C# classes - basic exampleHow to serve static files in Flask






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am looking for a method or a way to serve multiple html files to the site visitor the moment he enters the site.



Like:



Response.TransmitFile("index1.html");
Response.TransmitFile("index2.html");
Response.TransmitFile("index3.html");
Response.TransmitFile("index4.html");
Response.TransmitFile("index5.html");


I've went through AspNetCore documentation but haven't found anything sensible.



Any help appreciated.










share|improve this question
























  • How would you expect the browser to handle this? I think you're looking for a ZIP file (or some other archive format).

    – John
    Mar 9 at 9:12












  • not zip file, i dont want the file to be downloaded but displayed in html

    – PlzHelpMeSon
    Mar 9 at 9:14











  • Why do you want to send 5 files at once?

    – John
    Mar 9 at 9:28











  • Possible duplicate of Return multiple files to download from asp.net

    – mjwills
    Mar 9 at 10:18

















1















I am looking for a method or a way to serve multiple html files to the site visitor the moment he enters the site.



Like:



Response.TransmitFile("index1.html");
Response.TransmitFile("index2.html");
Response.TransmitFile("index3.html");
Response.TransmitFile("index4.html");
Response.TransmitFile("index5.html");


I've went through AspNetCore documentation but haven't found anything sensible.



Any help appreciated.










share|improve this question
























  • How would you expect the browser to handle this? I think you're looking for a ZIP file (or some other archive format).

    – John
    Mar 9 at 9:12












  • not zip file, i dont want the file to be downloaded but displayed in html

    – PlzHelpMeSon
    Mar 9 at 9:14











  • Why do you want to send 5 files at once?

    – John
    Mar 9 at 9:28











  • Possible duplicate of Return multiple files to download from asp.net

    – mjwills
    Mar 9 at 10:18













1












1








1








I am looking for a method or a way to serve multiple html files to the site visitor the moment he enters the site.



Like:



Response.TransmitFile("index1.html");
Response.TransmitFile("index2.html");
Response.TransmitFile("index3.html");
Response.TransmitFile("index4.html");
Response.TransmitFile("index5.html");


I've went through AspNetCore documentation but haven't found anything sensible.



Any help appreciated.










share|improve this question
















I am looking for a method or a way to serve multiple html files to the site visitor the moment he enters the site.



Like:



Response.TransmitFile("index1.html");
Response.TransmitFile("index2.html");
Response.TransmitFile("index3.html");
Response.TransmitFile("index4.html");
Response.TransmitFile("index5.html");


I've went through AspNetCore documentation but haven't found anything sensible.



Any help appreciated.







c# asp.net-core httpresponse static-files






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 9:12









John

14.4k42645




14.4k42645










asked Mar 9 at 9:11









PlzHelpMeSonPlzHelpMeSon

173




173












  • How would you expect the browser to handle this? I think you're looking for a ZIP file (or some other archive format).

    – John
    Mar 9 at 9:12












  • not zip file, i dont want the file to be downloaded but displayed in html

    – PlzHelpMeSon
    Mar 9 at 9:14











  • Why do you want to send 5 files at once?

    – John
    Mar 9 at 9:28











  • Possible duplicate of Return multiple files to download from asp.net

    – mjwills
    Mar 9 at 10:18

















  • How would you expect the browser to handle this? I think you're looking for a ZIP file (or some other archive format).

    – John
    Mar 9 at 9:12












  • not zip file, i dont want the file to be downloaded but displayed in html

    – PlzHelpMeSon
    Mar 9 at 9:14











  • Why do you want to send 5 files at once?

    – John
    Mar 9 at 9:28











  • Possible duplicate of Return multiple files to download from asp.net

    – mjwills
    Mar 9 at 10:18
















How would you expect the browser to handle this? I think you're looking for a ZIP file (or some other archive format).

– John
Mar 9 at 9:12






How would you expect the browser to handle this? I think you're looking for a ZIP file (or some other archive format).

– John
Mar 9 at 9:12














not zip file, i dont want the file to be downloaded but displayed in html

– PlzHelpMeSon
Mar 9 at 9:14





not zip file, i dont want the file to be downloaded but displayed in html

– PlzHelpMeSon
Mar 9 at 9:14













Why do you want to send 5 files at once?

– John
Mar 9 at 9:28





Why do you want to send 5 files at once?

– John
Mar 9 at 9:28













Possible duplicate of Return multiple files to download from asp.net

– mjwills
Mar 9 at 10:18





Possible duplicate of Return multiple files to download from asp.net

– mjwills
Mar 9 at 10:18












1 Answer
1






active

oldest

votes


















0














If I understand your goal, you are basically trying to have the site open multiple URLs when the user hits the site. In the questions, you specified "displayed in HTML", I'm assuming you mean actually rendered by the browser rather than just downloading the file.



In that case, your only real option I think is to use JavaScript on your View page to open new windows. Here's an example using the same URLs you specified above



<script type="text/javascript">
window.onload = function()
window.open("index1.html", "_blank");
window.open("index2.html", "_blank");
window.open("index3.html", "_blank");
window.open("index4.html", "_blank");
window.open("index5.html", "_blank");

</script>


Some notes & caveats with this approach:




  • This is not considered good behavior from a public website, and you might should reconsider if there's a better way to do what you want to do here. Abuse of this capability in the past is the reason for the next item as well.

  • Whether this works or not depends on whether the user allows pop-ups on your site. Virtually all modern browsers are going to block this by default, so you should include a graceful fallback for how to allow users to open the windows manually if they have pop-up blocking enabled.

  • This may have usability challenges for users who don't notice that a bunch of additional tabs have opened, specifically users who rely on screenreaders could have issues with this.

  • The "_blank" passed as the second parameter tells the browser explicitly to open in a new tab/window (based on the user's browser preferences). It's the default, but I like to specify it should the default change in the future.





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075742%2fhttpresponse-transmitfile-method-but-for-multiple-files%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If I understand your goal, you are basically trying to have the site open multiple URLs when the user hits the site. In the questions, you specified "displayed in HTML", I'm assuming you mean actually rendered by the browser rather than just downloading the file.



    In that case, your only real option I think is to use JavaScript on your View page to open new windows. Here's an example using the same URLs you specified above



    <script type="text/javascript">
    window.onload = function()
    window.open("index1.html", "_blank");
    window.open("index2.html", "_blank");
    window.open("index3.html", "_blank");
    window.open("index4.html", "_blank");
    window.open("index5.html", "_blank");

    </script>


    Some notes & caveats with this approach:




    • This is not considered good behavior from a public website, and you might should reconsider if there's a better way to do what you want to do here. Abuse of this capability in the past is the reason for the next item as well.

    • Whether this works or not depends on whether the user allows pop-ups on your site. Virtually all modern browsers are going to block this by default, so you should include a graceful fallback for how to allow users to open the windows manually if they have pop-up blocking enabled.

    • This may have usability challenges for users who don't notice that a bunch of additional tabs have opened, specifically users who rely on screenreaders could have issues with this.

    • The "_blank" passed as the second parameter tells the browser explicitly to open in a new tab/window (based on the user's browser preferences). It's the default, but I like to specify it should the default change in the future.





    share|improve this answer



























      0














      If I understand your goal, you are basically trying to have the site open multiple URLs when the user hits the site. In the questions, you specified "displayed in HTML", I'm assuming you mean actually rendered by the browser rather than just downloading the file.



      In that case, your only real option I think is to use JavaScript on your View page to open new windows. Here's an example using the same URLs you specified above



      <script type="text/javascript">
      window.onload = function()
      window.open("index1.html", "_blank");
      window.open("index2.html", "_blank");
      window.open("index3.html", "_blank");
      window.open("index4.html", "_blank");
      window.open("index5.html", "_blank");

      </script>


      Some notes & caveats with this approach:




      • This is not considered good behavior from a public website, and you might should reconsider if there's a better way to do what you want to do here. Abuse of this capability in the past is the reason for the next item as well.

      • Whether this works or not depends on whether the user allows pop-ups on your site. Virtually all modern browsers are going to block this by default, so you should include a graceful fallback for how to allow users to open the windows manually if they have pop-up blocking enabled.

      • This may have usability challenges for users who don't notice that a bunch of additional tabs have opened, specifically users who rely on screenreaders could have issues with this.

      • The "_blank" passed as the second parameter tells the browser explicitly to open in a new tab/window (based on the user's browser preferences). It's the default, but I like to specify it should the default change in the future.





      share|improve this answer

























        0












        0








        0







        If I understand your goal, you are basically trying to have the site open multiple URLs when the user hits the site. In the questions, you specified "displayed in HTML", I'm assuming you mean actually rendered by the browser rather than just downloading the file.



        In that case, your only real option I think is to use JavaScript on your View page to open new windows. Here's an example using the same URLs you specified above



        <script type="text/javascript">
        window.onload = function()
        window.open("index1.html", "_blank");
        window.open("index2.html", "_blank");
        window.open("index3.html", "_blank");
        window.open("index4.html", "_blank");
        window.open("index5.html", "_blank");

        </script>


        Some notes & caveats with this approach:




        • This is not considered good behavior from a public website, and you might should reconsider if there's a better way to do what you want to do here. Abuse of this capability in the past is the reason for the next item as well.

        • Whether this works or not depends on whether the user allows pop-ups on your site. Virtually all modern browsers are going to block this by default, so you should include a graceful fallback for how to allow users to open the windows manually if they have pop-up blocking enabled.

        • This may have usability challenges for users who don't notice that a bunch of additional tabs have opened, specifically users who rely on screenreaders could have issues with this.

        • The "_blank" passed as the second parameter tells the browser explicitly to open in a new tab/window (based on the user's browser preferences). It's the default, but I like to specify it should the default change in the future.





        share|improve this answer













        If I understand your goal, you are basically trying to have the site open multiple URLs when the user hits the site. In the questions, you specified "displayed in HTML", I'm assuming you mean actually rendered by the browser rather than just downloading the file.



        In that case, your only real option I think is to use JavaScript on your View page to open new windows. Here's an example using the same URLs you specified above



        <script type="text/javascript">
        window.onload = function()
        window.open("index1.html", "_blank");
        window.open("index2.html", "_blank");
        window.open("index3.html", "_blank");
        window.open("index4.html", "_blank");
        window.open("index5.html", "_blank");

        </script>


        Some notes & caveats with this approach:




        • This is not considered good behavior from a public website, and you might should reconsider if there's a better way to do what you want to do here. Abuse of this capability in the past is the reason for the next item as well.

        • Whether this works or not depends on whether the user allows pop-ups on your site. Virtually all modern browsers are going to block this by default, so you should include a graceful fallback for how to allow users to open the windows manually if they have pop-up blocking enabled.

        • This may have usability challenges for users who don't notice that a bunch of additional tabs have opened, specifically users who rely on screenreaders could have issues with this.

        • The "_blank" passed as the second parameter tells the browser explicitly to open in a new tab/window (based on the user's browser preferences). It's the default, but I like to specify it should the default change in the future.






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 14 at 15:03









        OperatorOverloadOperatorOverload

        444313




        444313





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075742%2fhttpresponse-transmitfile-method-but-for-multiple-files%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко