Passing dynamic data to controller with ASP.NET MVC and jQuery on form submit -


I have a website that is basically a page that has a bunch of dynamic content. The user should never leave this page in normal operation. However, to handle / report some errors, I need to redirect to an error page. So on the error page, I want to provide a link on a normal page that provides the necessary information to the app to rebuild all dynamic content that was already opened.

I think that I can rebuild the page by parsing the query string with javascript and reloading dynamic content. I'm not sure that this is the best way, but I have to do this work. The href should look like something in the link on my href page:

  MySite / MyController / MyAction? 1,5,8,9  

where the number of quickstring originally indicates the contents of the id to load sections on document.ready .

How can I generate this link now, I think that I need to pass these numbers in some way to the controller, so the controller can pass them in error view then " Back "link.

I have a standard HTML form for uploading files:

 using  (HTML.bizform ("MyAction", "Mac Controller", FormMath. Paste, New {Encrypt = "Multipart / Form-Data"})) {/ * ... * /}>  

Then I have a button which can be used by jQuery Calling .submit () method.

So, the question, when I click on the button that submits the form, how can I attach additional data so that I can access it in my controller?

Hope it is clear, if not told me and I can provide more details thanks.

Edit : It happened to me that I can submit this information in the form with a hidden field. I will try that if I can not get better, but if I want a more general solution then it is possible because I have many forms on the page and ideally I want to make this data available to anybody / everyone

Your URL must survive before sending the form. Submit () does not have HTML in the Start tag .... I can not see this problem here ... are you really working?


Comments