ViewData, ViewBag, TempData is server side state management technique or Client side
In Asp.net there are 2 types of State management technique
Server Side State management
- Session
- Application State
- Profile
Client Side state management
- ViewState
- QueryString
- Cookies
- Control State
- 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
add a comment |
In Asp.net there are 2 types of State management technique
Server Side State management
- Session
- Application State
- Profile
Client Side state management
- ViewState
- QueryString
- Cookies
- Control State
- 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
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 whatViewData
,ViewBag
andTempData
are). None of them have anything to do with client Side state management, and onlyTempData
relates to server Side State management (it usesSession
)
– user3559349
Nov 22 '18 at 7:15
add a comment |
In Asp.net there are 2 types of State management technique
Server Side State management
- Session
- Application State
- Profile
Client Side state management
- ViewState
- QueryString
- Cookies
- Control State
- 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
In Asp.net there are 2 types of State management technique
Server Side State management
- Session
- Application State
- Profile
Client Side state management
- ViewState
- QueryString
- Cookies
- Control State
- 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
asp.net-mvc
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 whatViewData
,ViewBag
andTempData
are). None of them have anything to do with client Side state management, and onlyTempData
relates to server Side State management (it usesSession
)
– user3559349
Nov 22 '18 at 7:15
add a comment |
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 whatViewData
,ViewBag
andTempData
are). None of them have anything to do with client Side state management, and onlyTempData
relates to server Side State management (it usesSession
)
– 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
add a comment |
1 Answer
1
active
oldest
votes
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
answered Nov 22 '18 at 7:16
Fakhar Ahmad RasulFakhar Ahmad Rasul
559412
559412
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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
andTempData
are). None of them have anything to do with client Side state management, and onlyTempData
relates to server Side State management (it usesSession
)– user3559349
Nov 22 '18 at 7:15