Good afternoon friends. I want to know how to correctly solve the following problem:
On the page there are two blocks: one conditionally "folders", the second part conditionally "files". Folder navigation is performed using Ajax and this part is implemented. Where there is a file there is a button "send to the current folder" (the one that is selected and opened now).
Question: how to get \ pass to the MoveToFolder(int ID_Folder, int ID_File) method MoveToFolder(int ID_Folder, int ID_File) . Variables called to facilitate understanding of the situation, the project is different, of course. ID_File is, and how to get ID_Folder , if navigation is performed dynamically without reloading the page?
The option to store the current ID_Folder in the session \ cookies is not suitable, because two different pages with different folders can be opened, respectively. It turns out that only <input type="hidden" /> . Here's the question, how do you put parameters from input hidden into Ajax.ActionLink ?
Most likely, because The page is generated BEFORE, as Ajax, we select the folder :) Then how? Maybe through OnBegin somehow? Or the only way to "handle" through jQuery to carry out a query and there already get a value with hidden value? The only way?
I found a solution, in my opinion, a very crutch (as for a guy with 11k reputation): https://stackoverflow.com/a/15104152/4727475
Looking further.
UPD.
This solution does not work for ActionLink - OnBegin works, but the URL is saved and changed after the Ajax request is sent. Alas, a little blood can not do (We'll have to draw a standard ajax through jQuery