Updating a session variable without postback
In the Category Controller class, add the following attribute: The above code disables the session state on request processing.Run the application and navigate to the Category/Search Products View, enter Category Id in the Text Box, and click on the ‘Search’ button.Since Temp Data makes use of the Session State behavior, it must be on the controller using Temp Data.By default it is always enabled, however using code, the session state can be disabled on the controller.In MVC the following image explains the scenario: Here the question is how to implement this? Step 1: Download the free Visual Studio 2013 Community Edition (the article uses VS2013 Ultimate with Update 4) and create a new empty MVC application of the name Add some sample data in these tables. Step 4: In the Controllers folder, add a new Empty MVC controller of the name Product Controller and add the following code in it: The above code has Index action methods for Http Get and Http Post.The Http Get Index method accepts the Temp Data[“Category”] object and type casts it to Category.NET have been around for a very long time, but their constant growth means there’s always more to learn. Use these concepts to deepen your existing knowledge of C# and . Click here to Explore the Table of Contents or Download Sample Chapters!We at Dot Net Curry are very excited to announce the The Absolutely Awesome Book on C# and . This is a 500 pages concise technical e Book available in PDF, e Pub (i Pad), and Mobi (Kindle). NET, to have a solid grasp of the latest in C# and .
The Same demo can be implemented using Session[“Category”] object to pass data across controllers.So instead of having: Hallo Frinny, Thank you for your reply.Actaully the problem not with the response redirect i think because the gvliste(gridview) nothing to store.I do not know if these examples are any good to me now, but if I'll have some trouble later on I will definitely check them out.
, Please take your time to examine the samples and feel free to turn to us if new questions arise.Do you want to know when a feature you care about is added or when a bug fixed?