ViewData, ViewBag, TempData is server side state management technique or Client side












0















In Asp.net there are 2 types of State management technique



Server Side State management




  1. Session

  2. Application State

  3. Profile


Client Side state management




  1. ViewState

  2. QueryString

  3. Cookies

  4. Control State

  5. Hidden Fields


I know that in Asp.net MVC above all state supported except ViewState and Control State.



I'm confused over ViewData, ViewBag, TempData in which category they belongs like Client Side State management technique or Server Side state management technique.



I mean if we store data in ViewData, ViewBag or TempData then where they holds memory space at Client machine or Server machine.










share|improve this question




















  • 2





    All 3 are server side. Refer also ViewBag, ViewData and TempData

    – user3559349
    Nov 22 '18 at 6:43













  • Hi Stephen Muecke are you sure because i'm not getting any confident answer i have serched lot of article. I confused because reading this article biswaranjan2010.wordpress.com/…

    – Sandeep
    Nov 22 '18 at 7:11











  • Read the link gave you (or hundreds of others that explain what ViewData, ViewBag and TempData are). None of them have anything to do with client Side state management, and only TempData relates to server Side State management (it uses Session)

    – user3559349
    Nov 22 '18 at 7:15
















0















In Asp.net there are 2 types of State management technique



Server Side State management




  1. Session

  2. Application State

  3. Profile


Client Side state management




  1. ViewState

  2. QueryString

  3. Cookies

  4. Control State

  5. Hidden Fields


I know that in Asp.net MVC above all state supported except ViewState and Control State.



I'm confused over ViewData, ViewBag, TempData in which category they belongs like Client Side State management technique or Server Side state management technique.



I mean if we store data in ViewData, ViewBag or TempData then where they holds memory space at Client machine or Server machine.










share|improve this question




















  • 2





    All 3 are server side. Refer also ViewBag, ViewData and TempData

    – user3559349
    Nov 22 '18 at 6:43













  • Hi Stephen Muecke are you sure because i'm not getting any confident answer i have serched lot of article. I confused because reading this article biswaranjan2010.wordpress.com/…

    – Sandeep
    Nov 22 '18 at 7:11











  • Read the link gave you (or hundreds of others that explain what ViewData, ViewBag and TempData are). None of them have anything to do with client Side state management, and only TempData relates to server Side State management (it uses Session)

    – user3559349
    Nov 22 '18 at 7:15














0












0








0








In Asp.net there are 2 types of State management technique



Server Side State management




  1. Session

  2. Application State

  3. Profile


Client Side state management




  1. ViewState

  2. QueryString

  3. Cookies

  4. Control State

  5. Hidden Fields


I know that in Asp.net MVC above all state supported except ViewState and Control State.



I'm confused over ViewData, ViewBag, TempData in which category they belongs like Client Side State management technique or Server Side state management technique.



I mean if we store data in ViewData, ViewBag or TempData then where they holds memory space at Client machine or Server machine.










share|improve this question
















In Asp.net there are 2 types of State management technique



Server Side State management




  1. Session

  2. Application State

  3. Profile


Client Side state management




  1. ViewState

  2. QueryString

  3. Cookies

  4. Control State

  5. Hidden Fields


I know that in Asp.net MVC above all state supported except ViewState and Control State.



I'm confused over ViewData, ViewBag, TempData in which category they belongs like Client Side State management technique or Server Side state management technique.



I mean if we store data in ViewData, ViewBag or TempData then where they holds memory space at Client machine or Server machine.







asp.net-mvc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 9:52







user3559349

















asked Nov 22 '18 at 6:38









SandeepSandeep

64




64








  • 2





    All 3 are server side. Refer also ViewBag, ViewData and TempData

    – user3559349
    Nov 22 '18 at 6:43













  • Hi Stephen Muecke are you sure because i'm not getting any confident answer i have serched lot of article. I confused because reading this article biswaranjan2010.wordpress.com/…

    – Sandeep
    Nov 22 '18 at 7:11











  • Read the link gave you (or hundreds of others that explain what ViewData, ViewBag and TempData are). None of them have anything to do with client Side state management, and only TempData relates to server Side State management (it uses Session)

    – user3559349
    Nov 22 '18 at 7:15














  • 2





    All 3 are server side. Refer also ViewBag, ViewData and TempData

    – user3559349
    Nov 22 '18 at 6:43













  • Hi Stephen Muecke are you sure because i'm not getting any confident answer i have serched lot of article. I confused because reading this article biswaranjan2010.wordpress.com/…

    – Sandeep
    Nov 22 '18 at 7:11











  • Read the link gave you (or hundreds of others that explain what ViewData, ViewBag and TempData are). None of them have anything to do with client Side state management, and only TempData relates to server Side State management (it uses Session)

    – user3559349
    Nov 22 '18 at 7:15








2




2





All 3 are server side. Refer also ViewBag, ViewData and TempData

– user3559349
Nov 22 '18 at 6:43







All 3 are server side. Refer also ViewBag, ViewData and TempData

– user3559349
Nov 22 '18 at 6:43















Hi Stephen Muecke are you sure because i'm not getting any confident answer i have serched lot of article. I confused because reading this article biswaranjan2010.wordpress.com/…

– Sandeep
Nov 22 '18 at 7:11





Hi Stephen Muecke are you sure because i'm not getting any confident answer i have serched lot of article. I confused because reading this article biswaranjan2010.wordpress.com/…

– Sandeep
Nov 22 '18 at 7:11













Read the link gave you (or hundreds of others that explain what ViewData, ViewBag and TempData are). None of them have anything to do with client Side state management, and only TempData relates to server Side State management (it uses Session)

– user3559349
Nov 22 '18 at 7:15





Read the link gave you (or hundreds of others that explain what ViewData, ViewBag and TempData are). None of them have anything to do with client Side state management, and only TempData relates to server Side State management (it uses Session)

– user3559349
Nov 22 '18 at 7:15












1 Answer
1






active

oldest

votes


















0














ViewData, ViewBag and TempData are all stored on the server. Use TempData when you want to send something from one action to another action method.
Use ViewBag and ViewData when you want to send data from an Action method to a view.



Also the best approach is to simply use ViewModels






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%2f53425168%2fviewdata-viewbag-tempdata-is-server-side-state-management-technique-or-client%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














    ViewData, ViewBag and TempData are all stored on the server. Use TempData when you want to send something from one action to another action method.
    Use ViewBag and ViewData when you want to send data from an Action method to a view.



    Also the best approach is to simply use ViewModels






    share|improve this answer




























      0














      ViewData, ViewBag and TempData are all stored on the server. Use TempData when you want to send something from one action to another action method.
      Use ViewBag and ViewData when you want to send data from an Action method to a view.



      Also the best approach is to simply use ViewModels






      share|improve this answer


























        0












        0








        0







        ViewData, ViewBag and TempData are all stored on the server. Use TempData when you want to send something from one action to another action method.
        Use ViewBag and ViewData when you want to send data from an Action method to a view.



        Also the best approach is to simply use ViewModels






        share|improve this answer













        ViewData, ViewBag and TempData are all stored on the server. Use TempData when you want to send something from one action to another action method.
        Use ViewBag and ViewData when you want to send data from an Action method to a view.



        Also the best approach is to simply use ViewModels







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 '18 at 7:16









        Fakhar Ahmad RasulFakhar Ahmad Rasul

        559412




        559412
































            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%2f53425168%2fviewdata-viewbag-tempdata-is-server-side-state-management-technique-or-client%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







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini