Search code examples
razor2sxc

2sxc Pass variables from one view (js) to another view (razor)


I need to create an app with 2 views:

  1. A view with html form for 3 selections (categories drop-down, two numeric fields), when submitted it loads the second view.

  2. A view with some razor code and a foreach loop that needs the 3 vars from the previous view (in a where clause).

What is the best way to pass vars from one view to another so that server side razor catches it? Can the 2sxc query system do this?

Thanks, João


Solution

  • standard asp.net stuff: usually you add this to the url like ?field1=something&field2=xyz

    then access it using Request.QueryString["field1"]