开发者

Storing 'session values' in MS MVC3

I'm getting started in MVC3 with a jquery/js driven front end. I realise that the paradigm of MVC is not to rely much on the concept of session variables and the like, instead using the actions and controllers to drive the user experience. I have the situation below, what's the proper way to do it?

a) I have a little menu with a set of 'select exhibit' options - show summary, show user details etc. Clicking one calls a controller (lets say 'rendersummary' or 'renderuserdetails') which returns a partialview back a certain div on my page.

b) I have a separate 'filters' panel, which lets you select 开发者_JS百科how many records to include, etc. In that, I have an 'apply' button. When you click apply, I'd like it to re-execute the last action again (eg rendersummary) but now using the new filter settings.

I recall you could use HTMLRoutings or something to see what the current action/args are, but am not sure how you'd do this for the most recent partialview.

Any thoughts?

Thanks!


You can define a special controller that get the data from the filter panel and redirect the call to the last action/controller executed. If you don't want to use Session to store the navigation's information, you can add some hidden input field to the filter panel and valorize them using js.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜