PsCraft
PsCraft

Reputation: 642

How to store data between postBack in asp mvc application

I have a master page in asp.mvc application. On this master page I have one hidden field which value should be saved between the postback. How Can I achieve it?

thanks,

Upvotes: 0

Views: 1161

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039498

How Can I achieve it?

This will depend on how you are performing those postbacks. One possibility would be to simply include it inside the form that you are posting. Another possibility is to use javascript and subscribe for the .submit event of your form and inside read the value of the hidden field and for example append it inside another hidden field to the current form or to the query string so that its value is sent to the server. There might also be other solutions. All will depend on your specific scenario and requirements.

Upvotes: 1

Related Questions