Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to send the Model from view to controller without @Html.BeginForm()
and also not via ajax call with each input control data.

What I have tried:

I have tried various methods like request parameters, FormCollection but all these need a form.
Posted
Updated 22-Jul-20 0:03am
v2
Comments
F-ES Sitecore 22-Jul-20 7:08am    
There is no way to do this. The problem you actually need to solve is why you can't use a form or ajax, so if you explain that someone might be able to help.
DevCodeproject1 23-Jul-20 2:05am    
No problem using ajax or form but I would like to know the solution for this without ajax or form
F-ES Sitecore 23-Jul-20 6:09am    
There are hacky ways to do it but if you don't mind using a form or ajax then just use them, that's the proper way.
DevCodeproject1 23-Jul-20 6:49am    
Thank you :) but Could you please tell me what is the hacky way. I Just want to know about it
F-ES Sitecore 23-Jul-20 7:18am    
You could have a hidden iframe or image and make the src property something like

whatever.aspx?p1=a&p2=b

where the values for p1, p2 etc are read from your form elements via javascript. Your "whatever.aspx" page will then process those values. How useful these things are largely depends on what you want to happen after you pass the data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900